NEW YORK — The price of oil rose above $97 per barrel Thursday, reversing Wednesday’s small drop.

In New York, crude rose 30 cents to finish at $97.31 per barrel. Brent crude, which is used to price oil that many U.S. refineries buy to make gasoline, rose 12 cents to end at $118 per barrel in London.

Crude rose sharply in early January, then began to waver between $95 and $98 per barrel, where it has stayed for the past month.

But just as oil prices began to flatten, retail gasoline prices began to take off. The average U.S. pump price has risen every day since Jan. 18, adding 34 cents over the period. Thursday it rose a penny to $3.63, the highest ever for this time of year.

Americans may be able to offset higher gasoline bills with lower heating and electricity bills. Natural gas futures fell 14.3 cents, or 4.3 percent, to finish at $3.16 per thousand cubic feet, after the Energy Department reported that the nation’s natural gas supplies remained well above their 5-year average last week.

Oil prices rose despite data showing continuing weakness in the European economy. The eurozone economy shrank by 0.6 percent in the final quarter of 2012 from the previous three-month period, more than the 0.4 percent drop expected by markets, according to Eurostat, the EU statistics office. Germany, Europe’s largest economy, shrank by 0.6 percent for the period.

Addison Armstrong, an analyst at Tradition Energy, said oil prices have stayed high because investors are using cheap credit brought on by low interest rates to invest in commodities. Also Saudi Arabia has reduced its output somewhat, shrinking world supplies slightly. And the U.S. and Chinese economies appear to be getting healthier.

Armstrong does not expect oil to continue to rise, however, because supplies are ample and demand is about flat. “I don’t expect we’ll revisit the highs we saw last year,” he said. “The fundamentals are going to reassert themselves soon.”

There is some disagreement on just how much the oil the world economy needs. On Wednesday the Paris-based International Energy Agency lowered its consumption forecast by 85,000 barrels a day compared with data from a month ago. On Tuesday OPEC raised its 2013 forecast for global demand, citing signs of recovery in the global economy.

The IEA expects the world to use 90.7 million barrels of crude oil a day this year. That is 1 million barrels a day more than OPEC’s estimate of 89.7 million barrels a day.