Oil retreated toward $50 a barrel on Thursday, erasing earlier gains after weak U.S. employment data and news that U.S. automaker Chrysler will file for Chapter 11 bankruptcy.

Prices had earlier advanced above $51 alongside a rise in global equity markets to their highest level since January on increased optimism about the economic outlook.

U.S. light, sweet crude for June delivery was down 8 cents at $50.89 a barrel by 1401 GMT (10:01 a.m. EDT) after a session high of $51.94.

Brent crude was down 21 cents at $50.57.

It could be the Chrysler news, said Chris Jarvis, senior analyst at Caprock Risk Management in New Hampshire. Seems like when the headline hit, that's when crude turned, he said.

Chrysler failed to gain bondholder support for a restructuring.

The number of U.S. workers filing new claims for jobless aid fell by 14,000 last week, but continued claims reached a new record high, government data showed.

The data boosted safe haven flows into the U.S. dollar, which posted gains versus the yen and this helped depress oil, which tends to fall if the dollar rises.

MARKET BALANCED?

Oil prices had risen by 2 percent on Wednesday after a surprise 4.7 million barrel decline in U.S. gasoline stocks ahead of the driving season, according to U.S. government data.

This also helped U.S. crude moved to a premium to Brent futures for the first time since the end of March, according to Barclays Capital research.

Gasoline was the strongest part of the data, Barclays said. Implied gasoline demand is fairly robust.

Barclays also pointed to Japan's oil demand data for March, released earlier on Thursday, where gasoline stood out as the strongest part of the demand barrel.

Iraq's oil minister said world oil markets seemed to be coming into balance.

Hussain al-Sharistani did not rule out a further cut in oil supplies by the Organization of Petroleum Exporting Countries at its next meeting on May 28.

The World Health Organization (WHO) raised its threat level on the swine flu virus and said a possible pandemic was imminent. A widespread outbreak of deadly flu could bear down on economic activity and trim energy demand.

Mexican President Filipe Calderon ordered a five-day partial shutdown of the economy to try to contain the virus.

Swine flu has become almost a sideshow for the oil market -- it might impact demand in specific areas like jet fuel, but if we can confirm the overall economy has bottomed, prices should slowly grind higher, said Paul Harris, analyst at Bank of Ireland.

(Additional reporting by Jonathan Leff and Maryelle Demongeot in Singapore; editing by Keiron Henderson)