Oil prices rose slightly on Wednesday as investors covered short positions after a rise in U.S. crude inventories was not as massive as many had feared, while gasoline futures jumped 4 per cent after a surprise decline in inventories of the fuel.

U.S. crude stocks rose by 13.8 million barrels in the week to Feb. 3 as refineries cut output, while gasoline stocks decreased, the Energy Information Administration said.

The surge in crude stocks did not shock the market, since preliminary data from the American Petroleum Institute (API) late on Tuesday showed an even bigger increase.

"A lot of the downside was already priced in," said Rob Haworth, senior investment strategist at U.S. Bank Wealth Management.

"In the near term, this is going to become a technical game of price levels and where speculators are going to capitulate. If we start to get through the lows of January, that could force some speculators to retrench their position."

Hedge funds and other speculators raised their net long U.S. crude futures and options positions in the week to Jan. 31 to the highest level on record, data showed on Friday.

"The crude oil inventory build was really terrible for the market but the market does not seem to care because the products inventories were better than expected and are dragging crude oil prices up with it," said Andrew Lipow, president of Lipow Oil Associates in Houston.

Gasoline futures settled 4.4 per cent higher at US$1.5527 a gallon after EIA data showed the surprise decline in inventories after five straight weeks of increases.

The U.S. gasoline crack spread, a key measure of refiner margins, jumped as much as 25 per cent, the biggest daily per centage gain in nearly a year.

Still, analysts said the gasoline market remained oversupplied.

"Prompt (U.S. East Coast) gasoline cracks continue to sell off and the contango in U.S. gasoline futures is deepening, reflecting the likelihood that the overhang will be carried into the summer months," Energy Aspects said in a note.

Brent crude futures settled at US$55.12 per barrel, up 7 cents or 0.13 per cent.

U.S. West Texas Intermediate (WTI) crude rose 17 cents, or 0.33 per cent, to settle at US$52.34 a barrel.

Analysts said prices could be volatile as higher U.S. crude supplies offset output cuts by the Organization of the Petroleum Exporting Countries (OPEC) and other producing nations.

Oil prices came under pressure early as Reuters calculations showed China's 2016 oil demand grew at its slowest pace in at least three years.