Last May, when the oil ministers of the Organization of Petroleum Exporting Countries met informally in Saudi Arabia to talk about OPEC policy and oil prices, there was a worldwide surplus of crude petroleum.

The oil states were turning out 2 million to 3 million barrels a day more than the market demanded. Under the circumstances even the hardliners who wanted to impose a major price increase, such a Libya and Iraq, were convinced that they could not make it stand up.

By Saturday, when OPEC's ministers convened here to set prices for 1979, the surplus had all but vanished.

Partly, it had been absorded by traditional heavy year-end buying by oil companies stockpiling in anticipation of a price increase.But the real difference came from an event beyond OPEC's control and not directly related to Petroleum demand - the turmoil in Iran, which virtually shut down the oil fields of the world's second largest oil exporting nation for several days.

With prices in the small free market climbing rapidly because of the Iranian crisis, OPEC was in a position to do what most of its members wanted to do, namely impose a substantial increase on the basic price of crude oil.

Mana Said Oteiba, the oil minister of the United Arab Emirates and president of OPEC, said the 14.49 percent price increase would not have a disruptive effect on world economy because oil traders were already offering more for oil on the free market than OPEC would be charging after its increases for 1979 were imposed.

"The law of supply and demand is in favor of the producers," he observed.

According to Sheik Zaki Yamani, oil minister of Saudi Arabia, the price increase might have been less but for the Iranian shutdown.

"The market today is in a unique situation, especially with the Iran crisis," he said.

It was "unique" because oil was at the same time plentiful and short - that is, world supplies are more than adequate under normal circumstances, at least in the short run, but the developments in Iran served as a reminder thatn the entire industry is subject to disruptions that can upset the balance.

There were many reasons why OPEC raised prices as high as it did in spite of the vigorous opposition of the United States.

Indeed, some OPEC delegates said that the cartel would have raised prices substantially even without the Iran developments and that the Iranian crisis merely provided Yamani with a cover for the fact that he did not resist the price pressure as hard as he had told the Americans he would.

Nor did the United States get much help from the Western European nations and Japan in its diplomatic campaign to persuade the produres to hold the price line. AS OPEC members happily pointed out, those nations are getting what amounts to a big oil discount because they buy oil with dollars that cost them less and less measured against their own currencies, and they did almost nothing to fight any price increase.

The buying power of the OPEC states has declined substantially because their revenue is in dollars. Many of the 13 member countries can already envision the day when their oil fields will be played out and they are determined to extract as much wealth as they can for their own development before that happens. As Oteiba put it, "We are developing countries. We need every dollar for our own development."

The U.S. argument that a price increase would only aggravate the inflation in the West and the fall of the dollar was not persuasive.

"We froze prices for the past two years and what was the result of that?" asked Valentin Hernandez-Acosta, the oil minister of Venezuela.

Experienced analysts of oil developments agreed with the contention of conference participants that the collapse of Iran's oil exports was a factor in the OPEC decision-perhaps not decisive, but important.

The disappearance from the supply chain of up to 4.5 million barrels a day that Iran would normally have been exporting made it possible for OPEC members to link the price increases to market demand, which they could not have done otherwise.

That is because there is in fact no worldwide oil shortage, nor is any likely for the next few years. The OPEC states, especially Saudi Arabia, still have the capacity to produce more oil than they are actually turning out and new discoveries, especially in Mexico and China, have added to the amount of oil available.

According to a report by GATT, the General Agreement on Agreement on Tariffs and Trade, world petroleum consumption has increased by only 1.1 percent a year on the average since 1973 while production has increased much faster.

"For industrial countries as a whole," the GATT report said, "There was no rise at all in consumption between 1973 and 1977, the slight increase in North America being entirely offset by the decline in Western Europe."

Where consumption is increasing, the report said, is in the developing countries, and especially in the oil exporting nations themselves, which are becoming voracious consumers of energy as they electrify, industrialize, motorize and develop petrochemical industries.

At the OPEC meeting, Yamani noted that Saudi Arabi had decided not to lift the limit it has imposed on its own production, which is an average over the year of 8.5 million barrels a day. Saudi export capacity, he said, is nearly 12 million barrels a day, but only if the Iranian shutdown continued would Saudi Arabia consider lifting its ceiling.

But they could if it were necessary to meet the demands of the consumers. Yamani and Hernandez-Acosta emphasized that the OPEC countries had no desire to create an artifical shortage as a price lever. More oil is available from other OPEC members if Iran cannot produce it.

But OPEC members also warned that this will not be the case by the end of the next decade. Yamani said be welcomed reports of major oil finds in Mexico and China because they could postpone the inevitable world shortage.

Oteiba warned that "by 1985, the world will face a great shortage of oil and the demand will grow much bigger."

He said it was necessary to stop using oil as a "cheap fuel"-that is, for gasoline-when it is needed as an industrial raw material.

That sentiment, widespread in OPEC, is believed to be at least partly responsible for the determination of several producers to make the industrialized states buy more "heavy" crude, which yields little gasoline and is harder to refine.

It will cost more to refine heavy crude, but the feeling in OPEC seems to be that a continued rise in the price of petroleum products to Western consumers might not be a bad thing. It would encourage conservation and perhaps stimulate the search for other sources of energy.