Oil prices were higher on Thursday after two dozen producer nations agreed to extend a deal to limit their production through 2018.

OPEC and other oil exporters led by Russia have kept 1.8 million barrels a day off the market since January, helping to boost crude prices about 40 percent from the lows of the year. The producers are meeting in Vienna on Thursday to discuss the deal.

OPEC members, Russia and nine other producers agreed on Thursday to replace the current deal that runs through March with an agreement that will be in place from January through December of 2018.

Traders entered the week confident that the group would extend the agreement by nine months through the end of 2018. But ministers sent mixed messages through Thursday, with Russia's hesitance to agree to a nine-month extension emerging as the main obstacle.

U.S. crude intraday

U.S. West Texas Intermediate crude ended Thursday's session up 10 cents at $57.40. It has fallen 2.6 percent since last week, pressured by a faster-than-expected restart to the Keystone pipeline and a rise in U.S. stockpiles of gasoline and distillate fuels.

oil for January delivery was up 45 cents at $63.56 a barrel by 2:29 p.m. ET, after earlier trading near a 2½-year high above $64. The January contract expires on Thursday. The more heavily traded February contract rose 9 cents to $62.62.

Oil futures came under pressure on Tuesday after sources told Reuters the group is considering a nine-month extension, but with a review of the deal in June. That left many oil market watchers with the impression producers had settled on a de facto three-month extension.

The producers will indeed review the deal at the next OPEC meeting in June.

Nigerian Minister of Petroleum Resources Emmanuel Ibe Kachikwu on Wednesday said the market is making too much of the idea of a midyear review.

"There's actually only one option," Kachikwu told CNBC. "Even if you do take full-year rollover, you will need to review that according to market behavior, so they are not necessarily apart."