President Reagan today announced the successful negotiation of a long-sought agreement that he said would limit European steel exports to the United States and "relieve our domestic steel industry from the unfair competition from subsidized foreign products."

The presidential announcement came after an emergency meeting of the European Economic Community in Brussels agreed on a formula in time to avert U.S. penalty tariffs that would have gone into effect this afternoon. The agreement, which came about after West Germany won concessions from its fellow members of the Community, removes a major irritant in America's trade relations with its West European allies.

In return for the agreement by the European Community, generally known as the Common Market, American steel companies dropped 42 complaints against European firms accused of either undercutting them in this country with subsidized steel or "dumping" steel here at below-market prices.

The American retaliatory tariffs would have been likely to heighten growing protectionist fervor in both the United States and Europe. The steel dispute has been second only to the U.S. imposition of sanctions against the Soviet natural gas pipeline as a source of friction with traditional allies.

Domestically, the president can use the agreement with the Europeans in his effort to convince American voters that unemployment will come down. The White House expects the steel agreement to have positive political consequences in the recession-ridden steel communities of the Northeast and Middle West. Moreover, it fits the president's basic election-year theme -- that economic recovery lies just ahead if the nation will only "stay the course" on which he has embarked.

"Our judgment is that this will give us a boost in Youngstown and other hard-pressed steel-producing cities," said White House spokesman Larry Speakes. "They've been in difficult straits for the past decade, and we've been working hard to get this agreement."

In Washington, Commerce Secretary Malcolm Baldrige said if the agreement had been in effect last year, 25,000 to 30,000 jobs would have been added to the American steel industry, which is suffering massive unemployment with an estimated 45 percent of the work force -- 200,000 persons -- off the job.

Reagan's announcement was the highlight of a campaign day in which the president also signed legislation aimed at assisting U.S. grain producers by allowing surplus grain to be used for agricultural byproducts, especially gasohol. After this bill-signing, the president gave an emotional campaign speech for embattled Nebraska Gov. Charles Thone, the first state chief to endorse Reagan during his 1980 presidential campaign.

The announcement of the steel accord had been scheduled for Wednesday in the White House, before the two-day campaign trip to Peoria and Omaha. But an unexpected complication in the complex transatlantic negotiation, brought about by Germany's demands for concessions from its fellow members of the European Community, made any announcement that day premature.

While Reagan held forth here, Baldrige took over the podium in the White House press room to provide a more detailed briefing on the consequences of the agreement, which he said covers almost all the steel Europe exports to the United States. Europe accounted for about six million of the 20 million tons of steel America imported last year.

The new agreement, covering 11 carbon steel products and alloys, would limit imports from Europe to about 5.12 percent of the total American market, compared to Europe's present market share of about 6 percent.

There is also a ceiling of 5.9 percent on European pipe and tube steel, a product used in oil drilling which is in oversupply on both sides of the Atlantic; Germany won agreement from its European partners that it was not bound by this ceiling.

The new limits take effect Nov. 1 and run through Dec. 31, 1985.

Baldrige said that if limits on the import of European steel had been in force last year about 1 million fewer tons would have come into the United States.

American steel importers, however, disputed that view. They asserted that any cut in imports of European steel is more likely to be made up by other parts of the world, especially Korea, Japan and Brazil, than by higher sales of American steel.

In order to have any impact, said Fred Lamesch, vice president of the American Institute for Imported Steel, similar agreements will have to be struck with other major exporters.

David Roderick, chairman of United States Steel Corp., who hailed the new agreement as more far-ranging than one American steelmakers rejected earlier this year, has threatened to file a trade complaint against the Japanese on grounds that their voluntary limit on exports to the European Community means they have more steel to ship here.

Baldrige made it clear that the European accord was not the answer to all of the American steel industry's problems, pointing out that productivity has not kept pace with wage increases and that plant modernization must be continued. He discounted concerns that the agreement would boost steel prices and contribute to inflation.

President Reagan was optimistic about the effects of the steel agreement as well as about economic prospects generally, although his campaign theme of "stay the course" has been greeted with skepticism in many sections of the Middle West.

In Peoria, where Reagan campaigned Wednesday night for the reelection of House Minority Leader Robert Michel, a cartoon in a local newspaper satirized the slogan as "stay the curse."

In Nebraska, where the president long ago agreed to campaign for Gov. Thone, falling farm prices and state budget deficits have also put Republicans on the defensive.

Thone is trailing Democratic nominee Bob Kerrey, according to most assessments, and Senate candidate James Keck is considered hopelessly behind the Democratic incumbent, Sen. Edward Zorinsky.

On the present trip White House advance teams have found it difficult to turn out large crowds for Reagan.

At the Michel rally Wednesday, a late decision was made to use a smaller hall, in which the 4,500 partisan supporters who showed up would be an overflow crowd. The originally planned arena seated 9,000 persons.

Today, most of the 8,200 seats in the Omaha arena were filled, but only because twice as many tickets were distributed as there were seats available and busloads of schoolchildren were brought in.

Reagan returned to Washington in late afternoon. He is to return to the campaign trail Tuesday, when he will fly to North Carolina.