Oil prices rose on Jan. 5 in an up-and-down session, lifted by news that Saudi Arabia had cut production to meet OPEC's agreement to reduce output after prices fell on data showing a surprisingly large increase in U.S. gasoline and distillate inventories.

Saudi Arabia cut oil output in January by at least 486,000 barrels a day (Mbbl/d), to 10.06 MMbbl/d, according to a Gulf source familiar with Saudi oil policy. That would mean the world's largest crude producer was holding up its end of a November agreement by OPEC.

That boosted oil prices, which had slipped after the U.S. government reported a big increase in U.S. gasoline and distillate inventories.

West Texas Intermediate crude settled up 50 cents, or 0.9%, to $53.76/bbl. Brent crude rose 43 cents, or 0.8%, to settle at $56.89/bbl after hitting a session high of $57.35/bbl.

Oil has rallied 23% since mid-November, with speculators loading up on long positions in crude futures in recent weeks in anticipation of OPEC's supply cuts.

U.S. government data showed futures speculators, as of the week of Dec. 26, had a bigger net long position in U.S. crude than at any time since mid-2014.

While some believe the rally has stretched too far, betting against gains has been a losing position. Official figures that reveal whether various countries are keeping to their word will not be known for a few weeks.

"The problem with being short here is, you're not going to see data that disputes [those statements] until late January," said Kyle Cooper, consultant with ION Energy Group in Houston.

Still, OPEC's task remains daunting. OPEC output in December was substantially higher than the level from where it agreed to lower output--by 1.2 MMbbl/d --according to a Reuters survey. That could make it harder to reach its target.

Overall output dipped to 34.2 MMbbl/d from 34.4 MMbbl/d in November, still 1.7 MMbbl more than OPEC's 32.5 MMbbl/d target.

U.S. crude stocks fell sharply to end the year, the Energy Information Administration said, with a draw of 7 MMbbl, but stocks of gasoline and distillates surged as refiners ramped up production to reduce crude inventories, a year-end practice to avoid higher taxes.

Refining runs jumped, particularly on the U.S. Gulf Coast, by more than expected even for the end of the year.

"The magnitude of the products changes were much larger than expected and overwhelming somewhat supportive crude data," said Scott Shelton, energy specialist at ICAP in Durham, N.C.