Oil futures ended higher in volatile trading Friday, as buyers re-entered the market ahead of contract expiration and traders remain convinced that long-term crude demand is on the rise.

Light, sweet crude for June delivery settled up $1.05, or 1.1%, to $99.49 a barrel on the New York Mercantile Exchange. With the contract expiring Friday, the more actively traded--and more expensive--July contract settled up $1.17, or 1.2%, to $100.10 a barrel.

Brent crude on the ICE futures exchange settled up 97 cents, or 0.9%, to $112.39 a barrel.

Oil futures traded in a wide range Friday, with the June Nymex contract falling as low as $95.99 before reversing course midway through the session. Contract expiration often leads to volatile sessions as market participants look to close out positions or reposition their portfolios.

"You're seeing a lot of short-term, not-confident trading in this market," said Raymond Carbone, president of oil options brokerage Paramount Options in New York.

Adding to the volatility was uncertainty about the overall direction of the oil market following steep declines over the last several weeks. Nymex crude has fallen sharply from its high near $115 a barrel hit May 2, as a series of recent reports suggest the economic recovery in the U.S.--the world's largest crude consumer--remains uncertain. The Nymex contract is down almost 13% so far in May.

Still, many market participants believe crude prices are still headed higher over the longer term, as the U.S. enters the summer driving season--a period of peak demand--and the fuel needs in emerging markets such as China increase.

In the meantime, however, the market "has no conviction," said Dominick Chirichella, oil analyst at the Energy Management Institute.

"I didn't see any major reason for prices to fall over $2 before; I don't see any reason for prices to be up a buck right now," he said of Friday's trading.

U.S. gasoline sales in April fell for the first time this year due to high pump prices, the American Petroleum Institute said Friday. Gasoline sales averaged 8.9 million barrels a day in April 2011, down 2.2% from the same month last year, the industry group said.

The decline came as retail gasoline approached the psychological barrier of $4 a gallon. Prices have since retreated somewhat from that level, however, amid a sell-off in the futures market.

A gallon of regular cost an average of $3.89 a gallon, AAA's Daily Fuel Gauge Report said Friday, down from $3.98 a week ago.

Still, the API report was the latest to suggest the U.S. economy remains on shaky ground. On Thursday, the Conference Board said the index of U.S. leading economic indicators unexpectedly fell in April, the first decline since June 2010. The report offers an economic outlook for the next three to six months in the U.S.

Front-month June reformulated gasoline blendstock, or RBOB, settled up 0.98 cent, or 0.3%, to $2.9358 a gallon. June heating oil settled up 2.36 cents, or 0.8%, to $2.9183 a gallon.