RIYADH, Saudi Arabia (AP) _ Saudi Arabia today dismissed Oil Minister Sheik Ahmed Zaki Yamani after a quarter century in office. Analysts predicted a realignment in OPEC's balance of power as prices fluctuated on world petroleum markets.

The official Saudi Press Agency, in a terse statement issued before dawn, gave no reason for Yamani's dismissal, but said he had been replaced by Planning Minister Hisham Nazer.

Nazer, considered a key minister in this kingdom of 11 million people, is thought to have close ties to the royal family. He was the first Saudi representative on the Organization of Petroleum Exporting Country's board of governors in 1961, and was deputy oil minister under Yamani for several years in the 1960s.

Saudi Arabia is the world's largest oil exporter. Oil analysts said Yamani's dismissal could cause a short-term decline in oil prices because of uncertainty about the new minister.

In The Netherlands, heating oil prices on the Rotterdam spot market fell slightly this morning, but recovered by early afternoon to about $14-$15 per barrel. One analyst, who spoke on condition of anonymity, called the early declines an ''emotional, knee-jerk reaction'' to the Saudi news.

On the New York Mercantile Exchange, contracts for December delivery of West Texas Intermediate, the benchmark U.S. crude, were sharply higher. The price of a 44-gallon barrel opened at $13.90 and quickly moved to $14.17, 44 cents above Wednesday's $13.73 close.

''Everybody's expecting a change in Saudi oil policy,'' said Edward Dellamonte, an analyst at Prudential-Bache Securities Inc. ''Probably we're going to see a more moderate policy, more conciliatory to the other OPEC members, and probably a return to Saudi Arabia's being a swing producer.''

Oil executives in Japan who spoke on condition of anonymity also said Nazer's appointment might signal a new conciliatory stance toward Saudi Arabia's opponents in OPEC, such as Iran. However, analysts elsewhere predicted no significant change in Saudi policies.

There had been rumors the 56-year-old Yamani - a commoner who uses the honorific title sheik - was ill and at odds with the royal family, and that King Fahd was making key oil policy decisions in recent months.

But there had been no direct evidence Yamani was in danger of losing his job.

In Paris, the Saudi interior minister, Prince Naif bin Abdulaziz, told reporters, ''There is nothing surprising about it and I don't think there is one particular reason (for it). ...Sheik Yamani did his work. He exercised his functions as minister who carried out the policies of his country.''

Naif, concluding a four-day visit, said there would be no change in Saudi Arabia's oil policy. ''Our oil policy is not tied to a change in men,'' he said.

Yamani had been responsible for Saudi oil policy since 1962, and is considered the architect of the 1973 Arab oil embargo and the first major oil price rise that reshaped the world economy.

He was the longest-serving and most widely known oil minister in the Organization of Petroleum Exporting Countries, which Saudi Arabia helped create in 1960.

His dismissal left a power vacuum within the cartel, and the oil ministers of Iran, Kuwait, the United Arab Emirates and Nigeria were viewed as contenders for the role of main power broker.

Yamani's whereabouts were not immediately known. He last was seen at a Cabinet meeting Monday, summing up OPEC's Oct. 6-22 meeting in Geneva, where the cartel agreed to extend interim production curbs through Dec. 31.

The 13-nation oil cartel has scheduled a meeting Dec. 11 to try to line up a new production-sharing agreement, or quotas for members.

From a price of $30 a barrel in December, oil fell to less than $10 a barrel by late spring because of overproduction. It since has crept up to between $14 and $17 per barrel.

In recent statements Saudi Arabia has made it clear it will demand an increase in its own production quota of 4.35 million barrels a day, about a quarter of the cartel's output.

Daniel Yergin, president of Cambridge Energy Research Associates of Cambridge, Mass., said it will be at least several days before the meaning of Yamani's removal becomes clear.

''Is it a change of policy or just a change of personnel?'' said Yergin, reached by telephone in Houston. ''When a commanding figure is no longer at the helm it makes people (in the oil industry) nervous.''

Yamani carried an aura of power and influence at OPEC meetings that made him stand out among his colleagues. He wore tailored Western-style business suits and commanded attention speaking in quiet, measured tones.

At this month's talks, however, King Fahd appeared to undercut him at a critical point. Yamani said Oct. 17 that Saudi Arabia would continue insisting that OPEC work out a permanent system of production quotas and that the Saudis be given a bigger share of the total.

But the next day, the Saudi government announced it was willing to go along with another interim arrangement.

Saudi production peaked at about 11 million barrels a day in 1981, but dropped to about 2 million barrels a day last year as the Saudis tried to offset a worldwide glut.

Yamani was one of 12 OPEC oil ministers seized in 1975 as hostaes by pro- Palestinian terrorists during a conference at OPEC headquarters in Vienna, Austria. He has traveled since then with bodyguards.

Yamani, born in Mecca in 1930, studied at Cairo University, New York University and in 1956 received a law degree from Harvard University.