House Minority Leader Robert H. Michel (R-Ill.) and other House Republican leaders yesterday agreed on legislation to renew funding to "contra" rebels fighting Nicaragua's Sandinista government by giving them $42 million in "humanitarian" assistance over two years.

The measure would reverse the vote two weeks ago by the Democratic-controlled House to deny aid in any form to the rebels this year. Lawmakers on both sides of the aisle have said they expect the House to renew nonmilitary aid, in part because of the recent trip to Moscow by Nicaraguan President Daniel Ortega.

They said it is unclear what sort of aid package the House might support, however. The GOP bill would provide $14 million this year and $28 million next year -- the level that President Reagan has requested.

It does not specify who would funnel the money to the contras, leaving open the possibility that it would be handled by the Central Intelligence Agency -- a move that could spark strong opposition in the House.

In addition, the legislation also might lift the current prohibition against any U.S. funds being used for military or paramilitary operations in Nicaragua. Republican sources said last night that that part of the bill has not been worked out. The House has voted for such a prohibition on several occasions.

Republican officials said yesterday that Michel will try to attach his proposal to the 1986 foreign aid bill, which is expected to come up for a vote in the House as early as next week.

GOP sources acknowledged that they will have to overcome several parliamentary roadblocks to get their bill considered because the Democratic leadership is certain to oppose it. The Democrats have supported assistance to refugees from Nicaragua, but not direct aid to the contras.

The Republicans are making the move at this time "to take the temperature of the House and see where we are. It's a little field trip," one leadership official said.

House Majority Leader James C. Wright Jr. (D-Tex.) said yesterday that it was likely the House would agree to support some proposal to aid the contras.

He said that most lawmakers do not support the idea of funding a rebel army to overthrow Nicaragua's leftist government, but that, because the CIA has helped organize the rebel forces, many lawmakers believe "we lured some of these contras into this activity" and therefore should not abandon them.