Under the cloud of the gravest crisis of his presidency, President Carter formally announced yesterday that he will seek reelection to continue moving the country in what he called "a new and better direction."

The president's somber announcement, which made him the 11th and presumably last declared presidential candidate of the two major parties, was made before several hundred staff and campaign aides in the East Room of the White House.

Stripped of the usual campaign ballyhoo by sensitivity to the crisis in Iran, the White House ceremony was sober and the brief announcement itself muted. But it still contained some of the main themes the president will use in the campaign against two Democratic Party rivals, Sen. Edward M. Kennedy (D-Mass.) and California Gov. Edmund G. (Jerry) Brown, Jr.

Acknowledging that he has made mistakes and that as he formally enters the campaign "I carry some scars and I carry them with pride," Carter called on the American people "to join me in looking squarely at the truth."

"I also carry the knowledge, strengthened by an experience in this office, that the greatness of our people will prevail," he said. "We have set a firm and constructive course for our country. It is a difficult course, but it is the right now -- and we must not turn aside."

The president formally entered the race still trailing Kennedy in most public opinion polls, with Brown generally considered a distant third. But in recent weeks, as Kennedy has been subjected to the intense scrutiny of a presidential campaign and Carter has won widespread praise for his handling of the Iranian crisis, the president's standing has risen. Viewed by some last summer as an easy target for the charismatic Kennedy Carter remains an embattled president but is now regarded as a formidable political force who will not be dislodged from office easily.

A key factor in this has been the crisis in Iran which has at least temporarily united Americans behind the president's leadership and for the last month virtually silenced the foreign policy criticisms of his Democratic and Republican rivals.

Carter referred to the situation in Iran in both his White House announcement and in a five-minute paid political message that was broadcast on CBS and a number of independent television stations last night.He condemned Iranian authorities for "outrageous" and "unlawful" actions, and said he will continue to curtail his overt political activity to monitor the situation.

The politics of the Iranian crisis also produced a last minute announcement of a change in the president's schedule. Less than eight hours before Carter was to leave the White House for a $500-per-person fund-raising dinner at the Washington Hilton, press secretary Jody Powell said Carter would not attend it.

Powell said the cancellation was not prompted by new developments in Iran, but by Carter's feeling that "it would not be appropriate [to attend the dinner] inasmuch as he has asked other candidates to be restrained."

Support for the president's call for unity on the Iranian crisis was shown by the chorus of criticism that descended upon Kennedy for his charge during a television interview Sunday that the deposed shah of Iran "ran one of the most violent regimes in the history of mankind." It illustrated that while Carter is free to speak about Iran in his capacity as president, as he did yesterday, his rivals for the moment can do little but publicly support him. At the same time, White House political strategists are clearly wary of allowing any suggestion that the president is exploiting the silence imposed on other candidates by his own campaign activity.

But the Carter campaign fund-raising efforts were to go on, with or without the president. Last week, Carter canceled a scheduled four-day campaign trip, although the announcement of the cancellation was delayed to minimize the impact on ticket sales to fund-raising events. Similarly, as late as Monday, White House and Carter reelection committee officials were saying that the president would attend last night's dinner at the Washington Hilton.

Instead, Vice President Mondale and Rosalynn Carter were the featured attractions at the dinner. They and several Cabinet officials will also leave Washington today in a revised schedule of campaign appearances without the president.

Hundreds of Carter aides, from Cabinet officials to anonymous campaign volunteers, jammed into the East Room of the White House for yesterday's announcement. With Mrs. Carter, the vice president and Joan Mondale beside him on the podium, the president made his announcement with a serious tone, and seemed moved by the repeated bursts of lusty applause that greeted his message.

Although Carter has made clear that Mondale will remain his running mate, he chose yesterday to reiterate that intention. He predicted that he will win the Democratic presidential nomination, and then instruct the Democratic National Convention in New York "to renominate the most effective vice president in the history of the United States -- Walter Mondale."

As Carter made his announcement, his new campaign chairman, Robert S. Strauss, offered a cautiously optimistic forecast for a campaign that Strauss said may emphasize White House work over grass-roots appearances, even after the Iranian crisis is ended.

"My general thinking," Strauss told a group of reporters, "is that the president stays on the job," and limits his campaign appearances to "a day or a day-and-a-half a week."

Asked if this was an updated version of the "Rose Garden strategy" for which Carter criticized then-President Ford in 1976, Strauss said "You may as well be cold in the Rose Garden as somewhere on the campaign trail."

While somewhat discounting the Monday Lou Harris-ABC poll putting Carter ahead of Kennedy by 2 points, Strauss said "every poll shows a steady climbing trend" for the president and he predicted "the lines will cross in the next 60 days."

Asserting that "the biggest story of the campaign to date is the lack of movement by Sen. Kennedy," Strauss said he "would be surprised" if the Carter-Kennedy contest "went all the way to the convention."

He said Carter could knock out Kennedy if he "maintains his southern base, captures Iowa, Illinois and New York." Conversely, he said, a loss to Kennedy in the March 11 Florida primary would be "much more harmful" to Carter than a setback in any of the northern states. "But I can't conceive of the president doing this."

As if fearful that he was sounding too optimistic, Strauss later in the same session said he expected a "hard tough fight," because Kennedy's "performance will improve. . . and the Kennedy campaign will pull itself together. . .We're really the underdog," he said.