The Reagan administration declined to testify yesterday on a telecommunications trade bill that would punish countries who close their markets to U.S. products by denying their products access to America.

Commerce Undersecretary Lionel H. Olmer, who was scheduled to testify before the Senate Finance Committee trade panel, said the administration has not yet come up with a position on the legislation, whose lead sponsor is Sen. John C. Danforth (R-Mo.), the subcommittee chairman.

Olmer, who will leave his present post in mid-June, has said in previous testimony that he thought the administration would look with favor on the bill.

"All I've seen out of this admininistration is talk when it comes to trade," said Sen. Lloyd Bentsen (D-Tex.).

"If it is really concerned, why isn't a representative here now . . . I think the administration's trade policy is in disarray."

He said the legislation is needed "because the administration has not taken steps needed to establish free trade in telecommunications," an area where the United States is considered to have a competitive edge in world trade.

Bentsen said he was told the administration decided against testimony for fear it might hamper talks going on in Bonn between Secretary of State George P. Shultz and Japanese Foreign Minister Shintaro Abe.

The proposal drew a mixed reaction from industry officials who testified before the subcommittee. Manufacturers generally supported the bill's basic aim, although they called for some changes.

Traders in telecommunications products, however, attacked the bill as protectionist.

The measure would give the U.S. government six months to determine where there are import barriers to U.S. telecommunications products, and then three years to negotiate market-opening agreements with the nations involved.

If no agreements are reached with a country, the president would be required to close U.S. markets to its telecommunications products.

In the case of Japan, the only country that now has a telecommunications trade agreement with the United States, the import ban would take effect in six months if Japanese markets remain closed.

"Traditionally, telecommunications markets in Europe as well as Japan are closed to the United States and we believe the bill will give us leverage to open them," said Danforth.