Updated

Oil prices settled higher Wednesday after the Federal Reserve said that U.S. economic growth has slowed but should pick up again soon. But they retreated in after-market trading as Fed Chairman Ben Bernanke said some of the economy's more serious problems could last into next year.

Benchmark oil for August delivery gained $1.24 to settle at $95.41 a barrel on the New York Mercantile Exchange. By late afternoon, after Bernanke spoke at a news conference, the price had fallen to $94.66 a barrel.

After a two-day meeting, Fed officials said in a statement that some reasons for the economy's slowdown, such as high gas prices and supply disruptions from Japan's natural disaster, are temporary. And once those problems subside, the economy should rebound.

Bernanke added though that some problems would be drags on the economy into 2012. "Maybe some of the headwinds that are concerning us, like weakness in the financial sector, problems in the housing sector ... some of these headwinds may be stronger and more persistent that we thought," Bernanke said.

His outlook for lingering problems in the economy pushed stocks down along with oil. The Dow Jones Industrial Average finished about 80 points lower. The S&P 500 and the Nasdaq were lower as well.

In addition the Fed said it will complete its $600 billion Treasury bond buying program by June 30 as planned and said nothing about further efforts to boost the economy

Signs of slower economic growth have left traders nervous about how oil demand could be affected in the months ahead.

Gas pump prices have fallen in recent weeks but are still nearly 90 cents higher on average than a year ago. Many consumers and businesses are more careful about spending, since fuel is taking a bigger share of household income.

AAA on Wednesday predicted a 2.5 percent drop in July Fourth weekend travel, largely because of high fuel prices. The auto club estimated 39 million Americans will travel more than 50 miles from home during the long holiday.

Expectations of a slower summer travel season have been reflected in oil, which has traded between about $102 and $93 a barrel for most of the month, said Michael Lynch, president of Strategic Energy & Economic Research.

Investors also have been concerned that Europe's economy could be affected if Greece defaults on its loans. That could lead to slower demand for oil and other commodities such as metals used in manufacturing. The new government in Greece won a vote of confidence which could help implement austerity measures required for it to get billions of dollars in emergency loans from Europe and the International Monetary Fund.

It could take time for all the steps to be completed, and that is leaving investors nervous, energy analyst Jim Ritterbusch said.

Closer to home, the Energy Department said the nation's crude supplies fell 1.7 million barrels to 363.8 million barrels last week. Gasoline supplies fell by 500,000 barrels to 214.6 million barrels. Demand for gasoline over the four weeks ended June 17 was 0.9 percent higher than a year earlier, averaging 9.3 million barrels a day.

The national average for regular gas fell a penny to $3.626 a gallon Wednesday, according to AAA, Wright Express and the Oil Price Information Service. That's down about 22 cents from a month ago.

In other Nymex trading, heating oil rose 6.49 cents to settle at $2.9549 per gallon, gasoline futures rose 9.07 cents to settle at $2.9733 per gallon and natural gas fell 7.1 cents to settle at $4.317 per 1,000 cubic feet.

In London, Brent crude gained $3.26, almost 3 percent, at $114.21 per barrel on the ICE Futures exchange.