The Soviet Union and North Yemen today signed a 20-year treaty of friendship and cooperation, a move that appeared to signal Moscow's rising profile in the Arab world.

The document was signed by Soviet President Konstantin Chernenko and North Yemeni President Ali Abdullah Saleh in a formal ceremony at the Kremlin. The two sides also signed a new consular convention.

At a Kremlin dinner in honor of the visiting North Yemeni delegation, Chernenko hailed the treaty as bringing the two countries' cooperation to "a new and even higher level."

Saleh described his visit as an "important milestone" in their relations.

The text of the new treaty was not immediately available.

The Soviet Union already has a friendship and cooperation treaty with South Yemen, whose Marxist regime is one of Moscow's staunchest backers in the Arab world.

South Yemeni leader Ali Nasser Muhammed was in Moscow on an official visit last week. He was received by Chernenko and other senior Soviet officials.

The conclusion of a treaty with North Yemen was seen by diplomatic observers here as indicating increased Soviet diplomatic and political activity in the Middle East following the failure of President Reagan's mediation efforts last year and the collapse of U.S. positions in Lebanon.

Two months ago the Soviet Union and Egypt reestablished full diplomatic relations. Kuwait, another moderate Arab state, recently concluded a major arms deal with Moscow.

Diplomats here also reported that Jordan is considering purchases of Soviet arms.

Moscow's successful effort to upgrade its relations with North Yemen was seen here as a move to improve its political position on the oil-producing Arabian Peninsula. North Yemen has good relations with Saudi Arabia and could serve as a "back door" for the Soviets in approaching the Saudis.

A communique issued by the official news agency Tass said the new treaty pledged the signatories to "develop and deepen the relations of strong friendship and all-round cooperation in the political, economic, trade, technical, scientific and cultural areas." There was no mention of military provisions.

The Soviet Union has a very close relationship with the government of South Yemen and has a military base there. South Yemen has a population of about 1.5 million and North Yemen has about 6 million.

The Soviets had established modest treaty arrangements with North Yemen in 1964, two years after the overthrow of the monarchy there. Moscow had at various times supplied it with weapons and other aid but these treaty arrangements expired long ago.

Saleh's government has been wavering in its policies ever since he came to power in 1978. In 1980, Saleh concluded an agreement with the Saudis under which he promised to move away from the Soviets in return for Saudi financial assistance.

The Yemeni president has kept on good terms with the United States -- at one time both U.S. and Soviet military advisers were in North Yemen -- but he has distanced himself somewhat from Washington in recent months.

In 1981, Saleh flew to Moscow for talks with Kremlin leaders in an effort to defer North Yemen's debt to Moscow and to request that the Soviets use their influence to persuade Marxist South Yemen to stop supporting dissidents in North Yemen.

During his current visit here, Saleh is believed to be trying to obtain Soviet financial and economic assistance.

Chernenko, in his dinner speech tonight, renewed Moscow's call for an international conference on the Middle East, to include the Palestine Liberation Organization as a participant.

The attitude of states to this proposal, he said, has become "a yardstick of their seriousness" toward the search for a peaceful settlement of the Middle East problem.

Chernenko denounced Israel's "aggressive ambitions" and unspecified U.S. "actions" against Arab states. But the tone of his speech was moderate and conciliatory.

A brief summary of the treaty said it was to be automatically extended for five years if neither side decides to terminate it by providing a six-month notice in 2004.