President Carter said tonight that he will meet with Egyptian President Anwar Sadat on Wednesday in an attempt to find ways to broaden the Middle East peace negotiations to include other moderate Arab nations.

The meeting, which is likely to be the most important of Carter's current seven-nation tour, will last only a few hours, but it is clearly intended to resolve differences that have arisen between Carter and Sadat in recent days on efforts to negotiate a Middle East peace.

Carter's announcement that he will meet with Sadat in Aswan, a southern Egyptian resort on the Nile, came shortly after the President arrived here for talks with the shah of Iran and Jordan's King Hussein.

U.S. officials announced, after the first round of talks tonight, that Carter and the shah had reached agreement on plans that, if approved by Congress, would result in the U.S. sale to Iran of six to eight nuclear power reactors.

Carter received a warm welcome from the shah and crowds along the streets as the two were driven through central Tehran, but earlier, heavily armed Iranian police broke up demonstrations by several hundred anti-American protestors. Witnsses said there were several arrests.

The demonstrations were reportedly much less violent, however, than those that occurred Washington in November when supporters and opponents of the shah clashed near the White House during a visit by the Iranian leader.

Carter told reporters of his plan to visit Sadat - which had been the subject of considerable speculation the last few days - as he was leaving a sumptuous New Year's Eve state dinner at the shah's Niavaran Palace.

Earlier in Cairo, Egyptian officials had said that Sadat was expecting the President on Wednesday. In an apparent effort to strengthen his case, Sadat released a statement today indicating that Egypt is ready to guarantee that a future Palestinian state would not start a war against Israel.

Sadat's statement, carried by the official Middle East News Agency, said:

"Egypt is ready to extend all guarantees that will provide for the safety and security of all countries in the region. We understand Israel's reasons for security but at the same time the Palestinians have a definite right to self-determination."

The Carter-Sadat meeting will last only a few hours, squeezed in Wednesday as part of the president's journey that day from Riyadh, Saudi Arabia, to Paris.

Zbigniew Brzezinski, the White House national security adviser, said that because of the President's tight schedule the meeting with Sadat could be only "a couple of hours."

The purpose of the meeting, Brzezinski said, will be "to see whether the process can be extended to more moderate Arabs, the Jordanians, themoderate Palestinians, and the Saudis."

That is the immediate objective of American foreign policy in the Middle East - to turn Sadat's bold peace initiative and his subsequent negotiations with Israeli Prime Minister Menahem Begin into broader discussions with other Arab nations, thereby isolating the radical elements in the Arabs world.

Whether a few hours in Aswan will move the United States toward that goal is far from certain. Sadat in recent days has been highly critical of the United States, accusing it of favoring Israeli demands for military outposts in some of the most volatile parts of occupied Arab territory. That is something Carter has taken great pains to deny during this trip.

News of the Sadat meeting was no the only unexpected Middle East development here tonight as the President and his entourage celebrated the coming of the New Year nine hours before 1978 dawned in Washington.

As Carter and the shah were toasting each other near the end of the state dinner King Hussein of Jordan - whom the President will meet here on Sunday morning - was ushered quietly into the gold-decorated palace.

Hussein's unscheduled appearance after the dinner was arranged so that he, Carter and the shah could ring in the New Year together. They posed for pictures together, and there was a loud cheer as they joined other guests for the celebration.

Hussein is one of the Arab leaders that the President seeks to entice into joining the Egyptian-Israeli discussions, but Hussein in recent days has shown resistance to joining broader Middle East negotiations.

During the New Year's Eve festivities, Carter met privately with Hussein for 20 minutes. No details of the discussion were disclosed.

These developments, with their impact on the unfolding drama of the Middle East peace negotiations, tended to overshadow Carter's visit to Iran.

Carter and the Shan met for an hour and a half early this evening and, according to American officials, they reached agreement on the conditions under which the United States will sell nuclear power plants and related technology to Iran.

The details of the agreement, aimed at slowing the spread of nuclear technology, were not disclosed, but they were described as comforming with the nonproliferation legislation that the Carter administration now has pending before Congress.

In effect, the agreement here will pave the way for the United States to sell six to eight light water nuclear re-actors to Iran, something the Shah has sought.

Two other subjects of interest to the two governments were not discussed according to U.S. officials. Iran's desire to purchase additional F-16 fighter planes did not come up because, according to one official, it has been handled at lower levels. nor were world oil prices discussed, although the President did publicly thank the Shah for his support for the six-month freeze on world oil prices voted this month by the Organization of Petroleum Exporting Countries.

American officials also said the two leaders agreed that they should take "constructive steps in concert" to bring peace to both the Middle east and the Horn of Africa. What those constructive steps might be was not disclosed.

In his toast tonight, and earlier during remarks at the arrival ceremony at Tehran airport, Carter gently reminded the Shah of his concern over human rights. But the issue of human rights was generally downplayed and if either of the leaders recalled the tear gas and the rioting around the White House when anti-and pro-Shah factions clashed in Washington in November, neither mentioned it publicly.

Security throughout the President's visit here was extraordinary, but it did not prevent three separate anti-American demonstrations - none of them near Carter - during the day.

At the airport, Carter predicated the passage "soon" of his stalled national energy legislation, but he did not dwell on the subject while in this oil-rich nation.

En route here from Warsaw, a senior White House official expressed satisfaction with the President's 36-hour visit to Poland, which he said was aimed at demonstrating that the United States has an interest in Eastern Europe separate from its dealings with the Soviet Union.