NAIROBI -- The month-old Persian Gulf crisis is creating economic crosscurrents for some of the 45 nations of sub-Saharan Africa, where the politics of Islamic fundamentalism and the financial impact of oil play key roles in shaping the lives of millions of people.

International oil experts, economists and political analysts specializing in Africa say the crisis may prove a bonanza for the oil-producing nations of Nigeria, Gabon and Angola, where higher petroleum prices are likely to provide billions of dollars in additional export revenues.

At the same time, those analysts said, Africa's many non-oil-producing countries will have to pay larger amounts of scarce foreign exchange for oil, their primary source of energy. Those nations also may suffer severe losses in export earnings if the crisis spurs a world recession, as many analysts fear.

"There is little doubt that the oil producers in Africa will benefit quite well," said Charles Constantinou, chief of the energy and resources branch of the U.N. Secretariat's Department of International, Economic and Social Affairs in New York. "The real problem will be down the line, I think, with the countries that import. They are more vulnerable to international shocks than any in the world. They are highly dependent on oil, yet in the weakest position to buy it at higher prices, particularly if supplies are short."

Most African nations condemned Iraq's Aug. 2 invasion of Kuwait and supported the United Nations' economic sanctions.

But a few African states -- including Mauritania in the continent's northwestern region and, to a somewhat lesser extent, Sudan in the east -- have supported Iraqi President Saddam Hussein in meetings of the Arab League and at the United Nations. The reason appears to stem from Islamic and political loyalties established between Iraq and those African nations in recent years.

In Mauritania's case, Saddam was the only world leader to lend complete diplomatic support for Mauritania in its border dispute with Senegal last year. That conflict, rife with racism and religious bigotry, pitted Mauritania's Islamic regime against the non-Moslem, darker-skinned rulers of Senegal. Hundreds of civilians died in the border skirmishes, which spurred mass exoduses of black Mauritanians to Senegal and of Moslem Senegalese to Mauritania.

Partly in appreciation for Saddam's diplomatic support and apparently to help garner greater recognition and respect in the Arab world, Mauritania's military ruler, Col. Muawiya Ould Sidi Ahmed Taya, allowed Iraq to test its arsenal of medium-range ballistic missiles in his country's vast desert earlier this year, according to U.S. officials and other reports. Those tests raised serious alarms in Washington and Israel.

Two months ago, Mauritania was widely vilified in the West for yet another reason. The human-rights group Africa Watch charged that slavery persisted in the country, with tens of thousands of black Mauritanians still enslaved to Arab masters in the countryside 10 years after the government announced it had abolished the practice.

In Sudan, the year-old government of Gen. Omar Hassan Ahmed Bashir has been dominated by supporters of the fundamentalist National Islamic Front, according to Western analysts, and the country has been criticized as a "human-rights disaster" by Africa Watch, which cited political repression on a scale "never before seen" in Sudan.

In recent months, Sudan has received military assistance from Iraq and financial and other aid from Libya, which also has supported Saddam in the current gulf crisis. Meanwhile, Sudan has faced deteriorating relations with and aid cuts from some of Iraq's current opponents, including Saudi Arabia, the United Arab Emirates and the United States.

Among African nations considered likely to reap economic gains from the gulf crisis, Nigeria has been cited as a prime example. As recently as a month ago, Nigeria was expected to earn about $6.7 billion in 1990 for its oil exports. This total was pegged to the world price then of about $16 a barrel.

But since the crisis triggered a rise in oil prices to more than $25 a barrel, Nigeria's earnings, taking into account slightly higher oil production there, likely will increase to more than $12 billion, said Ian Bourne, editor of the London-based monthly Petroleum Economist.

"Nigeria may do quite nicely," he said. "But all oil producers will do well, even if they are already producing at top capacity."

Nigeria, Gabon, Angola and Africa's more marginal oil producers, Congo and Cameroon, already are pumping oil near or at capacity. Unlike Saudi Arabia and Kuwait, where producing oil is, according to Bourne, as easy as "digging a hole and pumping it out," Africa's oil reserves are generally offshore and much more costly to develop.

For the majority of Africans, however, higher oil prices can only mean greater hardship for a continent already carrying more than its share of burdens.

According to United Nations' energy statistics compiled before the gulf crisis, African countries were expected to import 119 million barrels of oil this year at a cost of about $2.1 billion. Since the Iraqi invasion, however, that bill may double to $4.2 billion, a price this impoverished continent can ill afford.

When Saudi Arabia recently announced that it would expand production from 5.4 million barrels a day to 7.4 million, its leaders asserted that one of the chief reasons for doing so was to continue to provide oil to the world's developing nations.

Still, the increase may not stave off problems for Africa. Many economists warn that a world recession triggered by steep oil prices may prompt lower demand and sharp drops in international prices for the basic commodities, such as cocoa and coffee, that many African countries, such as Uganda and Ivory Coast, rely on for the lion's share of their foreign-exchange earnings.

More directly, according to the United Nations' Constantinou, "many of these countries in Africa may have comparatively small consumption of oil, but they depend on oil much more than the industrial countries. Many of them have no gas or coal or hydroelectric power. . . . Oil supplies, to them, are absolutely essential."

During the 1974 oil crisis, the International Monetary Fund set up a special facility to lend developing countries foreign exchange to pay for oil imports. That, however, was during a time when those countries were not nearly so heavily indebted as they are now. "What the IMF and the World Bank may be willing to do in case the gulf crisis becomes much bigger is questionable," said a Western economist here.

Shortages and high prices for oil would affect Africa's inland countries more than any in the world, he said, because those countries have no refineries and depend almost exclusively on imported and high-priced refined oil products.

With Iraq's invasion of Kuwait, three large export refineries there were effectively shut down. "For Africa, there may be much more of a problem in attaining products because of shortages of refining capacity elsewhere," the economist said.

When the United Nations recently imposed sanctions on Iraq, the organization's members were asked to submit reports on the possible impact of the embargo on their economies. Constantinou said he has not yet seen any reports from African countries, but he expects the worst.