By Nicole Friedman 

NEW YORK--Oil prices rallied Wednesday as traders closed out positions following a dramatic plunge in prices in recent months.

Light, sweet crude for January delivery recently rose $2.12, or 3.8%, to $58.05 a barrel on the New York Mercantile Exchange, after trading as low as $54.21 a barrel in early trading.

Brent, the global benchmark, recently rose $2.43, or 4.1%, to $62.44 a barrel on ICE Futures Europe.

Market watchers attributed the rebound to traders who had bet on lower prices closing out positions. Oil prices have plunged nearly 50% since June to the lowest level in more than five years.

"The uncertainty in the market is creating a lot of price volatility," said Gene McGillian, senior analyst at Tradition Energy. "I don't think we've seen enough to suggest that the market's found a bottom yet."

Traders are also likely trying to lock in profits before year-end, said Donald Morton, senior vice president at Herbert J. Sims Co.

"People are just going to shuffle around a little bit going into the end of the year and take some of their gains off the table," he said.

U.S. oil supplies fell by about 800,000 barrels in the week ended Dec. 21, the U.S. Energy Information Administration said Wednesday. Analysts surveyed by The Wall Street Journal had expected a loss of 1.9 million barrels.

However, distillate stocks, including heating oil and diesel, unexpectedly fell by about 200,000 barrels. Analysts had expected a 1 million barrel increase.

Market watchers have already warned in recent months than distillate supplies are too low ahead of the winter, when heating-oil demand is strong.

In the Northeast, where heating-oil consumption is high, distillate stocks stood at 36.1 million barrels as of Dec. 12, the lowest level on record, according to EIA weekly data going back to 1990.

"We're really setting ourselves up for a very tight winter market," Mr. Morton said. "These numbers are low. These numbers need to be watched carefully."

Diesel futures, which can also serve as a proxy for heating oil, recently rose 7.54 cents, or 3.9%, to $2.0354 a gallon.

Gasoline supplies rose by 5.3 million barrels, more than the 2-million-barrel rise analysts had expected.

"The U.S. refineries continue to exhibit an ability to really crank out refined products," said Kyle Cooper, analyst at IAF Advisors in Houston.

Gasoline futures recently rose 5.55 cents, or 3.6%, to $1.5965 a gallon.

"People are just going to shuffle around a little bit going into the end of the year and take some of their gains off the table," he said.

Markets are also braced for the outcome of the U.S. Federal Reserve meeting later on Wednesday, which could signal that a rate increase is likely in mid-2015. Commodity markets have benefited from the easing of U.S. monetary policy in the past few years and could come under pressure if the Fed tightens its stance.

Georgi Kantchev contributed to this article

Write to Nicole Friedman at nicole.friedman@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires