A federal judge yesterday accused the Reagan administration's antitrust official of misleading the public by failing to disclose a previous business relationship with International Business Machines Corp. before deciding to drop the government's 13-year-old antitrust suit against the computer giant.

Charging Assistant Attorney General William F. Baxter with creating, at the very least "the appearance of impropriety," U.S. District Court Judge David N. Edelstein called for a congressional investigation into the dismissal of the case and of Baxter's role as a consultant for IBM lawyers six years ago.

J. Jackson Walter, director of the Office of Government Ethics, said his agency "certainly will do what the judge asked," Associated Press reported. He added that if fault were found with Baxter's handling of the matter, "It's possible we could recommend administrative discipline by the Justice Department."

Justice Department sources, who asked not to be identified, told AP that the department's internal investigators in its Office of Professional Responsibility would review the judge's allegations.

Ever since Jan. 8, when the government dismissed the suit, "The court . . . has been concerned that the Department of Justice may not have acted in the best interests of the public," said Edelstein, who has presided over the lengthy and frequently stormy antitrust suit since it went to trial seven years ago.

"It is absolutely essential that the public believe that this case was resolved through a genuine adversary, and not collusive, relationship," Edelstein added in a brief, hastily called hearing in his courtroom in New York only days after he received a letter from an IBM competitor disclosing the relationship.

Within hours after the hearing, Baxter held a press conference to deny Edelstein's charges of impropriety, calling his relationship with IBM lawyers "essentially irrelevant" and "trivial." What's more, Baxter criticized the judge for calling the hearing without giving him advance notice of the charges so he could have been in New York to explain the relationship. The hearing "lacked a certain amount of style," Baxter said.

At issue is Baxter's relationship with a California law firm that had been representing IBM in one of the many antitrust suits filed against the computer giant during the 1970s.

In 1975, the law firm of O'Melveny & Myers called Baxter, then a law professor at Stanford University, to see if he was interested in being an expert witness on IBM's behalf. Baxter said he was not "a good choice" because he was not a "card-carrying Ph.D.," Baxter said yesterday.

However, he agreed to find them the right expert and began reviewing the writings of an economist to determine if he would be a good witness. For that service, which ended in 1976, Baxter said he believes he received about $1,500.

Although Baxter disclosed several of his business relationships to the Senate Judiciary Committee during his confirmation hearing, he said he did not feel it necessary to mention this one, which took place six years ago, "because it was so trivial," especially considering he had scores of similar consultations with private laywers too numerous to list.

However, he said he never refused to divulge the information to those who asked, including the lawyer from Memorex Corp. who recently wrote Baxter asking about his relationship with IBM. Baxter's reply to the Memorex vice president was forwarded to Judge Edelstein.

Up to then, neither the judge nor Congress knew of the relationship. "The apparent failure of Mr. Baxter to disclose this relationship itself creates an appearance of impropriety," Edelstein said yesterday. "Any question of a conflict of interest requires, at a minimum, complete disclosure."