By Alison Sider, Sarah McFarlane and Biman Mukherji

Oil futures wavered between gains and losses Friday, with volatility expected ahead of a meeting later this month of major oil-producing countries aiming to strike a deal to cut output and stabilize prices.

Oil markets have been in a tug of war this week as major oil producers have tried to indicate optimism about an agreement to cut production, even as a strengthening U.S. dollar and data showing an unexpectedly large increase in U.S. oil supplies have weighed on prices.

"I think it's going to be a little bit of a choppy day today," said Tariq Zahir, managing member of Tyche Capital Advisors. "There's a lot ofrhetoric out there, but you can't ignore what happened with the inventory numbers, and the dollar is a massive headwind," he said.

West Texas Intermediate futures turned negative, reversing earlier gains. U.S. oil prices were down 24 cents, or 0.53%, at $45.18 a barrel on the New York Mercantile Exchange. Brent, the global benchmark, was down 14 cents, or 0.3%, at $46.35 on London's ICE Futures exchange.

Prices moved lower despite encouraging statements from major oil producers, indicating they believe the Organization of the Petroleum Exporting Countries will reach an agreement on output quotas at its Nov. 30 meeting.

The Wall Street Journal reported Friday that Iraq's oil minister said he is optimistic about the prospects for an agreement, and that some of the country's issues with the deal have been hashed out. Iraq had seemed to be the cartel's most intransigent member in recent weeks.

Gene McGillian, research managerat Tradition Energy, said he expects prices to stay close to the $45 level until the deal's fate becomes clear.

"The market is showing it's uncertain about what's going to happen," Mr. McGillian said.

The market has been particularly sensitive to statements coming out of Doha this week, where talks between OPEC members on the sidelines of a gas forum were expected to give some indication of progress toward a deal to cut oil production to between 32.5 million and 33 million barrels a day, from record levels of around 33.83 million barrels a day in October.

Russian Energy Minister Alexander Novak said talks between OPEC and non-OPEC members had proved "positive," according to Interfax news agency.

Saudi Energy Minister Khalid al-Falih told Saudi-owned Al Arabiya television on Thursday that he is "optimistic" that OPEC's members will formalize the tentative deal they reached in September and set production limits for individual countries.

But observers are skeptical about a quick outcome.

"There is a lot of uncertainty on OPEC's ability to reach an outcome," said Peter Lee, Asia oil and gas analyst at BMI Research. "I am personally not optimistic."

The impact of any agreement between OPEC members to lower production could also be offset by surging output from non-OPEC producers, such as Russia, where production hit a post-Soviet high of 11.2 million barrels a day in October.

"Russia has earlier spoken with mixed voices regarding joining OPEC in an output cut or freeze," said Michael Poulsen, oil risk manager at Global Risk Manager.

Oil markets were also under pressure from a strengthening U.S. dollar after comments from Federal Reserve Chairwoman Janet Yellen raised expectations that the central bank will raise interest rates next month. A stronger dollar makes oil more expensive in other currencies.

The WSJ Dollar Index was up0.42% Friday, having advanced for nine consecutive trading days, its longest winning run since 2009.

Gasoline futures fell 0.87 cent, or 0.65%, to $1.3343 a gallon. Diesel futures rose 0.41 cent, or 0.28%, to $1.4511 a gallon.

Selina Williams and Benoit Faucon contributed to this article

Write to Alison Sider at alison.sider@wsj.com, Sarah McFarlane at sarah.mcfarlane@wsj.com and Biman Mukherji at biman.mukherji@wsj.com

(END) Dow Jones Newswires

November 18, 2016 12:25 ET (17:25 GMT)

Copyright (c) 2016 Dow Jones & Company, Inc.