If you’re in the oil business, chaos pays.

With allied warplanes bombing Libya, Saudi troops in Bahrain, and fleets of Japanese nuclear reactors idled by earthquakes and a tsunami, the price of a barrel of West Texas Intermediate-grade crude oil has soared in the past three months — up $16 to a towering $106.79 a barrel.

“The rising tide lifts all ships. All oil companies will make more money than anyone estimated just two months ago,” said Fadel Gheit, oil analyst with Oppenheimer.

“Every dollar increase in the price of oil gives Exxon $450 million a year more income,” Gheit added. The stocks of oil refiners have been “on fire,” he said. And oil service companies are also riding the wave of new investments by exploration firms eager to hurry and boost production while prices are high.

“They want to accelerate production while the party lasts,” Gheit said.

Exxon Mobil’s stock price climbed 15 percent in the first quarter of 2011, typical of some of the big integrated oil firms whose businesses span exploration, production, refining and marketing. (That works out to a $54 billion increase in the company’s market capitalization, which finished the quarter at $415 billion.) The stock price of Valero, the biggest oil refiner in the United States, soared 30 percent in the quarter. And the stock of Cameron, maker of the blowout preventer that failed to stop last year’s giant oil spill in the Gulf of Mexico, is up 23 percent from its price the day before the spill.

The source of these higher profits lies in crude oil prices that — except for a stint in 2008 — are as high as they’ve ever been.

“I have no doubt that there will be companies that approach, and possibly even exceed, the record earnings levels in the first half of 2008, when oil prices peaked,” said Pavel Molchanov, an oil analyst at the investment firm Raymond James. The recent price of Brent crude — the benchmark used by companies in Europe, Africa, the Middle East and Russia — has been higher than in any first quarter ever and higher than all but two quarters in history, the middle two quarters
of 2008. Even with transportation problems weighing on the price of West Texas Intermediate, its recent price has been higher than all but four quarters ever.

A smaller cushion

Those prices have been driven up, in part, by the political earthquakes taking place across North Africa and the Middle East, where movements for political freedom have shaken up autocrats and royals, and geological earthquakes that knocked out Japanese nuclear plants and oil refineries, boosting demand for fuel oil and products.

In Libya, what began as a protest movement has morphed into a civil war with heavy U.S. and allied bombing raids in support of rebels. Oil exports, once nearly 1.5 million barrels a day, have slowed to a trickle.

While this represents a loss of less than 2 percent of world supplies, it shrinks the world’s excess 4.5-million-barrel-a-day production capacity by about a third. Many oil analysts say that once spare capacity drops below 4 percent of world capacity, prices are likely to firm up. Moreover, nearly all of that spare capacity lies in Saudi Arabia, which has stuck its toe into Bahrain’s troubled political waters and whose king was worried enough about potential unrest to unveil $36 billion in new social programs.

In addition, Libya’s particularly easy-to-refine crude oil — known in the business as light and sweet for the absence of sulfur — is hard to replace. Although Saudi Arabia, already the world’s largest oil exporter, has offered to replace Libyan crude on the market, so far inventories in Europe have declined.

There is also much debate among oil analysts about whether Saudi spare capacity is smaller than it appears. It isn’t clear how much oil Saudi Arabia was producing before the Libya crisis, and some experts doubt Saudi claims about being able to crank up to 12.5 million barrels a day from the estimated current level of 9 million barrels a day. The kingdom has not produced more than 10 million barrels a day for years.

As it has become clear that the fighting in Libya will not come to a quick and relatively bloodless conclusion, analysts and experts have increased their oil price forecasts for 2011.

On March 7, Citigroup’s oil analysts boosted their forecast of the benchmark Brent crude to $105 a barrel, a $15 increase.

On March 8, the federal Energy Information Administration raised its forecast for the average cost of crude oil to refiners to $105 a barrel in 2011, $14 higher than its forecast a month earlier. And on March 24, Barclays Capital analysts upped their average oil price forecast for West Texas Intermediate to $106 a barrel, up $15. Those averages would top 2008, when prices spiked as high as $147 a barrel.

“A reduced capacity cushion and the fear that spare capacity dips below 4 percent of the market maintains the oil price at $100 into 2012, we believe,” wrote the Citigroup analysts Faisel Khan and Mark C. Fletcher.

The winners

If you’re an oil company, this isn’t entirely bad news.

“Any company that produces oil, no matter where they are geographically, is benefiting from the higher risk premium and therefore from higher prices,” Molchanov said.

Exxon, for example, produced 2.5 million barrels a day worldwide during the fourth quarter of last year — none of them in Libya.

Khan and Fletcher told investors that Citigroup was boosting its earnings-per-share estimates for major oil companies by an average of 23 percent for 2011 and 14 percent for 2012. They singled out Marathon, Imperial and ConocoPhillips.

ConocoPhillips, they said, “is in a position to benefit from the current global dislocations” because of its long-standing crude oil production in Alaska and the North Sea and from half a million barrels a day of refining capacity in the middle of the United States.

The Citigroup analysts also boosted profit forecasts for Chevron by 16 percent for this year, noting that it has the least exposure of any of the oil giants to the Middle East and North Africa.

The California-based oil company has about 100,000 barrels a day of oil production in the partitioned neutral zone between Kuwait and Saudi Arabia but otherwise produces its barrels elsewhere, thus positioning it to benefit from higher prices.

Rising prices for crude oil often put the squeeze on oil refiners, which can have trouble pushing up gasoline prices fast enough to keep pace. For them, crude oil is a raw material and a cost. But recently refiners have done well, too.

That’s because a peculiar quirk in the U.S. oil pipeline system has created a glut in Cushing, Okla., a terminal whose price serves as the benchmark for the New York Mercantile Exchange. That has lowered crude prices for the refiners such as Valero while gasoline pump prices have spiralled upward.

The explanation of the quirk is this:

High oil prices have stimulated more production of oil from shale rock in the Bakken formation in Montana and North Dakota and from tar sands in Canada. All that oil is carried by pipelines into the Midwest, but there isn’t enough pipeline capacity to carry it to refineries in other parts of the country.

So prices at Cushing are lower than they would be otherwise. Meanwhile, the nationwide average of a gallon of regular gasoline stood at $3.66 a gallon Monday, according to the auto club AAA, up 83 cents from a year ago and just 45 cents short of the all-time record set at the peak of driving season on July 17, 2008.

So for now, refiners are having a great run — and not only companies such as Valero. ConocoPhillips is reaping extra profit from its central and Rocky Mountain refining operations, the Citigroup analysts said.

Citigroup said it expects that the price differential between West Texas Intermediate and the similar-quality Brent in London — which has been as wide as $15 a barrel — will continue for another year or two.

Trickle down

The money pouring into the integrated major firms is flowing to oil service companies, too.

Halliburton, whose cement job on the Macondo well has been accused of contributing to the BP oil spill debacle, announced it has experienced “disruptions due to geopolitical issues in certain locations in the Middle East and North Africa” and said it would lower earnings by 3 to 4 cents a share. In 2010, the company earned $1.8 billion, or $1.97 a share, from continuing operations.

Nonetheless, there is so much new drilling taking place that Halliburton stock rose 21 percent in the first quarter. The shares are 48 percent higher than they were the day before the Macondo well exploded, killing 11 people.

Cameron is another example. A federal investigation recently found that Cameron’s blowout preventer had major flaws that contributed to its failure to stop the blowout that triggered last year’s oil spill. And Cameron also announced that it would take a 2 cent-a-share charge against earnings because of money it was owed by the Libyan government that it no longer expects to collect.

But oil companies still need blowout preventers as subsea exploration grows from Nigeria to Brazil and back to the Gulf of Mexico.

U.S. regulators will demand improvements, but Cameron is the dominant player in that market, and the new regulations will only mean more work for the company.

As Gheit put it, “They make a gadget everybody needs to put on their wells.”