Higher oil prices boosted quarterly profits for Exxon Mobil Corp and ConocoPhillips , but Exxon saw its earnings hurt by recently enacted U.S. health reform legislation.

The healthcare costs, weak performance from its refineries and higher-than-expected exploration costs pulled Exxon's earnings below Wall Street forecasts, a stark contrast with rivals BP Plc and Royal Dutch Shell Plc , which both topped market expectations when they released quarterly figures earlier this week.

Benchmark U.S. oil prices averaged nearly $79 a barrel in the first quarter, about $3 above the previous quarter and sharply higher than the $43 average of the first quarter of 2009.

That strength offset weak margins from Exxon and Conoco's refinery operations, which have been hurt by weak demand for fuels such as gasoline and diesel because of the soft global economy. However, the steady rebound in many regions is expected to pull up fuel demand later this year.

Our results reflect higher crude oil realizations and stronger chemical margins while the downstream industry margins remained weak, Rex Tillerson, Exxon's chief executive, said in a statement on Thursday.

Exxon's shares slipped 0.5 percent to $68.83 on the lower-than-expected earnings, but the losses were limited by the nearly $2 jump in crude oil prices on Thursday.

Conoco's shares rose by 1.4 percent to reach $59.84 per share.

Smaller exploration companies Apache Corp and Occidental Petroleum Corp also saw profits boosted in the first quarter, benefiting from a near doubling in the price of crude oil from a year earlier.

RISING CRUDE

Exxon's profit in the quarter rose 38 percent to $6.3 billion, or $1.33 per share.

Jason Gammel, oil analyst at Macquarie Research, characterized Exxon's first-quarter profit as a pretty big miss, and attributed the bulk of the shortfall to Exxon's accrual for the health care legislation.

That legislation sapped earnings by $200 million, or about 4 cents per share. Wall Street analysts had expected Exxon to report a profit of $1.41 per share, according to Thomson Reuters I/B/E/S.

The company's oil equivalent production rose 4.5 percent from a year ago, fueled by the company's liquefied natural gas (LNG) projects in Qatar, it said.

The production numbers looked great, I was looking for 2.5 percent growth, Gammel said.

But Exxon's downstream arm, which includes its refining and marketing operations, posted profits of $37 million, well off the $1.1 billion it earned a year ago.

Conoco, the third-largest U.S. oil company by market share, saw its profits rise sharply to $2.1 billion, but oil and gas output in the quarter fell to 1.83 million barrels of oil equivalent (BOE) per day from 1.93 million BOE per day a year ago.

Conoco, which is in the midst of a plan to shore up returns and reduce debt by selling $10 billion in assets, said on its conference call that it expects oil and gas output to be lower for the next several quarters.

The Houston-based oil major is making progress, however. Chief Executive Officer Jim Mulva said the company may boost its 2010 spending plan from about $11 billion to $12 billion, with investments targeting assets like the Eagleford and Bakken Shales that bring higher returns.

Occidental Petroleum's first-quarter profit tripled from a year earlier to $1.1 billion, or $1.32 per share, while Apache Corp swung to a profit of $705 million, or $2.08 per share, from a $1.76 billion loss last year.

Apache, the largest U.S. independent oil and gas producer by market capitalization, reported a profit compared with a year-earlier loss and said its oil output in the quarter rose 68 percent from a year-ago, lifted by two new projects in Australia. Still, its results lagged Wall Street expectations.

In London, gas producer BG Group reported a 5 percent fall in first-quarter net profit to $960 million as a glut in the global gas market hit gas prices, but underlying profits rose, beating expectations.

Shares of Apache fell 2.8 percent and Occidental shares rose 1 percent on the New York Stock Exchange.

(Reporting by Anna Driver and Matt Daily; Additional reporting by Tom Bergin in London and Braden Reddall in San Francisco; Editing by Phil Berlowitz)