NEW YORK (Reuters) - Oil prices settled higher on Friday, closing out a strong week that saw crude buoyed by growing expectations that OPEC will find a way to cap production at the end of the month.

Slideshow ( 2 images )

For the week, Brent and U.S. crude both rose roughly 5 percent, their first weekly gains in about a month.

The Organization of the Petroleum Exporting Countries (OPEC) is moving closer to finalizing its first deal since 2008 to limit output, with most members prepared to offer Iran flexibility on production volumes, ministers and sources said.

Iran has been the main stumbling block for capping production. While it has not yet responded to the proposal, the flexibility shown by others suggests OPEC members may be coming nearer to consensus as the Nov. 30 meeting approaches.

Brent notched a daily rise of 37 cents, or 0.8 percent, to $46.86 per barrel. Brent also had its first weekly increase in five weeks.

U.S. West Texas Intermediate crude was up 27 cents, or 0.6 percent, for the day, at $45.69 a barrel. It posted its first weekly increase in four.

Crude has been moving up and down based on statements by OPEC members ahead of its Nov. 30 meeting, said James L. Williams, energy economist at WTRG Economics in London, Arkansas.

“It kind of depends on which side of the bed the OPEC ministers wake up,” he said of oil prices. “People keep digesting and re-digesting the news.”

Williams said prices could fall below $40 if OPEC does not reach a deal on Nov. 30.

Stephen Brennock of oil brokerage PVM said there were still obstacles for OPEC to overcome.

“Iranian and Iraqi intransigence to the proposed output cuts remains in full force while competitive pressures among OPEC members was highlighted by news that Iran displaced Saudi Arabia as the top oil supplier to India,” he said.

An OPEC output cut should boost profitability for U.S. producers. Activity continues to rise in the U.S., as oil services company Baker Hughes said U.S. drilling rigs rose by 19 to 471 in the week to Nov. 18.

Gains were limited by a rallying dollar, which reached its highest levels against a basket of currencies since 2003 after U.S. Federal Reserve Chair Janet Yellen said on Thursday a rate increase could happen “relatively soon.”

A stronger dollar makes oil, which is priced in the greenback, more expensive to buyers using other currencies.