The House Foreign Affairs Committee agreed yesterday to provide about three-fourths of the military aid that President Reagan wants for El Salvador next fiscal year, but only if the Salvadoran government begins unconditional talks with the leftist guerrillas there.

Under terms of the 36-to-1 vote, the government would have 90 days from enactment of the foreign aid bill to begin the discussions. There would be no cutoff if the guerrillas refused to participate in the talks.

The committee decision repeated the pattern of recent weeks in which the administration, while getting less for El Salvador than it first sought, has nevertheless gotten more than critics first threatened to give it.

The Democratic-controlled Foreign Affairs panel gave Reagan $65 million of the $86.3 million he requested for El Salvador next year and the same amount in fiscal 1985. Last night it also voted the same amount for the current year, for which Reagan's request has been $136 million.

The Senate Foreign Relations Committee Tuesday granted $76.3 million a year for fiscal 1983 through 1985. It also attached conditions to the aid, including a cap of 55 on the number of U.S. military advisers allowed in El Salvador.

In addition, both House and Senate Intelligence committees have voted to restrict covert U.S. aid to rebels fighting the leftist government of Nicaragua.

William Schneider Jr., undersecretary of state for security assistance, claimed a qualified victory in yesterday's vote. "The consciousness of Congress has been raised on the subject of El Salvador and we're getting more support" than before, he said.

Schneider said the administration did not oppose the assorted conditions placed on the aid, which took up several days of negotiations among conservatives and liberals on the committee.

Reagan has in the past rejected calls for unconditional discussions between the Salvadoran government and guerrillas but Schneider said the Salvadoran government could still fend off any move toward "power-sharing" on the part of the Marxist rebels.

Another condition placed on the aid requires an affirmative vote by both houses of Congress in September, 1984, in order for the administration to continue military aid. "That puts Congress in the position of heavy involvement in the management of the process," Schneider said. "Perhaps Congress will not feel it wants to be so involved by the time this bill reaches conference."

While the El Salvador issue was resolved in bipartisan fashion in both House and Senate authorizing committees, it must be dealt with again in the Appropriations committees and could face divisive debate on the floor of both houses.

In recent years, moreover, foreign aid authorization bills have proven politically difficult to pass and the aid program has been folded into end-of-the-year continuing funding resolutions instead. So the aid question also may have to be fought out when the 1984 continuing resolution comes up.

The House committee bill originally limited military aid to El Salvador to $50 million a year. However, on a motion by Rep. Daniel A. Mica (D-Fla.) and Michael D. Barnes (D-Md.), $15 million a year was added of which $5 million is for medical supplies and the rest for training Salvadoran troops outside of El Salvador.

The Mica-Barnes compromise passed 21 to 7, with relatively little discussion, but with praise on both sides for the bipartisanship of the agreement.

However, Rep. Gerry E. Studds (D-Mass.) said the agreement masks deep divisions.

"If one wants to be cynical, one could say that the only real consensus in this committee is that we should avoid the subject of El Salvador," he said.

The bill requires the Salvadoran government to show progress on human rights and land redistribution. "We do not want to see a guerrilla victory, but we do not want to see the United States provide assistance to a government whose security forces remain responsible for the abduction and torture of thousands of people," said Rep. Stephen J. Solarz (D-N.Y.).

Although he voted for it, Rep. Henry J. Hyde (R-Ill.) reflected the uneasiness of conservatives on the committee, calling the compromise "a marvelous legerdemain . . . . We've put the president in a straitjacket, stuffed him in a trunk and dropped him in the river."

In other action on the $7.6 billion foreign aid bill, the committee reversed itself on previously approved restrictions on aid to Turkey.

Instead of an aid embargo to take effect in 1986 if the Turks do not remove troops on Cyprus, the committee voted to allow increases in aid if the president certifies that Turkey is taking steps to achieve a settlement of the Cyprus conflict.