Communications Satellite Corp. said yesterday it will sell two small units to Contel Corp. for $38 million and terminate the planned $2.5 billion merger of the two companies.

American Satellite Co., a subsidiary of Contel, will acquire a unit that provides international private-line services and a business that builds and installs small satellite dishes.

Contel, the big Atlanta-based telephone company, had been seeking to terminate the planned merger with Comsat, which was proposed in September. Contel cited Comsat's regulatory problems, including an FCC order in April requiring Comsat to refund $62 million of excess earnings.

The sale of the two unregulated businesses may alleviate concerns in Congress and regulatory agencies about a potential conflict of interest within Comsat.

Comsat is both the U.S. government's representative in international communications cooperatives and a competitor in unregulated businesses.

Comsat Chairman Irving Goldstein said that with the divestiture, "we are drawing a clearer line of distinction between our Intelsat and Inmarsat business and our unregulated businesses."

The sale is subject to approval of the Federal Communications Commission and to review for antitrust considerations.

Comsat sells satellite capacity for international telephone and television communications networks.

Created by the Communications Satellite Act of 1962, Comsat is the U.S. signatory to Intelsat, a 114-country cooperative that operates a communications network that transmits most of the world's international telephone calls and television broadcasts. Comsat also is the U.S. signatory to Inmarsat, which handles international maritime communications.

Comsat International Communications Inc., one of the units being sold to Contel, provides international private-line services, including voice, data and video, to 19 foreign countries. Those services use Intelsat facilities and buy time through the regulated side of Comsat's business.

Rep. Edward J. Markey (D-Mass.), chairman of the House Energy and Commerce telecommunications subcommittee, said in a statement the agreement is "a step in the right direction and realization from Comsat that its dual role as signatory and competitor in the unregulated satellite business was a blatant conflict."

Gerard Salemme, a subcommittee attorney who handles common-carrier issues, said the Comsat business that raised the most questions was Comsat International Communications, but he said Congress "will need time to see the final corporate shape of Comsat and see if conflict still exists."

Comsat spokesman Richard L. McGraw said the agreement was not intended specifically to address Congress' concerns, "although we recognize it may have that additional benefit.

"In the case of Comsat International Communications, we should not be competing with our own customers and that's what we were doing," McGraw said.

Comsat International Communications, as an end-to-end service provider, competes with American Telephone & Telegraph Co., MCI Communications Corp., US Sprint Communications Co. and other long-distance carriers. All are customers of Comsat.

The Comsat International Communications sale excludes the Intelsat gateway earth stations, a half dozen very large earth stations through which all Intelsat traffic flows. Comsat, under FCC orders to divest itself of those earth stations, had previously arranged to sell them to AT&T at the end of the year, McGraw said.

Comsat International Communications had revenue of $3.3 million and an operating loss of $7.1 million for the first six months of 1987, McGraw said.

Comsat's very-small-aperture-terminal business consists of the design, manufacture and installation of small earth station antennas. It had revenue of $6.8 million and an operating loss of $3.2 million for the first six months of 1987.

Comsat's other unregulated businesses include Comsat Video Enterprises, which distributes in-room entertainment to hotels nationwide; Comsat Government Systems, which sells communications services to the federal government; Comsat Technology Services, a consulting service for private telecommunications networks, and Aplica Inc., which manufactures defense electronic hardware. Comsat also distributes all of NBC's television programming nationwide.