A Soviet court convicted two American correspondents of "slander and defamation" yesterday, ordered that they print retractions within five days and assessed each $1,648 in court costs.

The uprecedented move was seen by Western analysts here as an attempt to impose a degree of press censorship on foreign journalists working in the Soviet Union.

The guilty verdict againat Craig Whitney of the New York Times and Harold Piper of the Baltimore Sun was based on articles they wrote in May quoting friends of a Soviet dissendent as saying that the dissident's televised confession was faked by Soviet state television.

[In Washington, the State Department deplored the conviction and said it was considering possible retaliatory steps. An official of the Soviet Embassy was summoned to come in today to discuss a variety of issues including the fate of the San Francisco bureau of the Soviet news agency Tass.]

Editors of the Times and the Sun deplored the verdict and said they would refuse to print the required retractions, thus setting the stage for a possible eventual expulsion of the two journalist from the Soviet Union. But they said they were studying the question of paying court costs.

Yesterday's three-hour trial included a surprise appearance of the Soviet dissendent, Zviad Gamsakhurdia, who was brought from a prison as a prosecution witness to deny that his televised confession had been faked or filmed without his knowledge.

Judge Lev Almazov of the Moscow City Court, in siding with the prosecutor, said that there was ample evidence that the two U.S. reporters had slandered the State Television and Radio Committee, which controls Soviet media.

But he specifically disregarded the prosecutor's recommendation that the Foreign Ministry be notified to review the newsmen's credentials with the aim of revoking them as "unsuitable." This option seems an eventuality in the nasty atmosphere prevailing around the issue.

Donald Patterson, managing editor of the Sunpapers, said in Baltimore yesterday. "There's nothing we can retract. I can't see us printing a retraction so he (Piper) will probably be asked to leave the country."

Seymour Topping, the Times' managing editor, in a statement released by the paper's Moscow bureau, declared that the guilty verdict "implies that American reporters can be hauled into court at any time and penalized for reporting in a full and fair manner on events in the Soviet Union. This severe inhibition denies American reporters freedom enjoyed by Soviet reporters in the United States. The Times will not print a retraction of Mr. Whitney's accurate May 24 dispatch which he filed in good faith after conscientious reporting."

Both reporters are in the United States on previously scheduled vacations. Topping said the paper expects Whitney "will carry on his work in the normal manner" when he returns to Moscow.

Almazov brushed aside the newsmen's contention in statements they had given him July 3 that Soviet courts do bot have juriskiction over material printed in American newspapers and not sold here. The judge accepted Procurator Georgyi Skoredov's contention that the papers were sold here, that one of the articles had been reprinted in the Interntional Herald Tribune which can be obtained here with great difficulty, and that the gisy of the dispatches had been broadcast by the voice of America on May 28 in a Russian language program.

His ruling, if it stands, gives unprecedented new scope to Soviet courts in overseeing foriign correspondents.Censorhip was ended here in 1961 by the late Nikita Khrushchev. Almazov gave the newsmen ten days to appeal his decision to the Supreme Court of the Russian Federation.

The plaintiff, Viktor Lubovtsev, 45, acting news editor on the program "Vremya" (Time), in summarizing his allegations before almazov and two "peoples's assessors" retired to consider a verdict, declared that the evidence presented showed that "unsavoury journalism has been caught red-handed."

Vremya last night broadcast a lengthy segment from the trial, showing Gamsakhurdia testifying and watching his filmed confession, giving some of the judge's findings and focussing on two empty chairs set up across from the prosecutor's desk. Skoredov asserted that the absence of the newsmen "proves the inability to prove their innocence."

He added, "through the mass media, they try to paint this country with black paint. We insist on objectivity." He condemned journalists "who abuse our hospitality."

Whitnet and Piper had told Almazov after three closed conferences that they would not actively participate in the suit as defendants, contending they could be askied to violate journalistic ethics and reveal their anonymous sources.

The two filed separate dispatches May 24 from Tbilisi, capital of Soviet Georgia, quoting unnamed dissidents as questioning the authenticity of Gamsakhurdia's confession. The confession was televised nationally on May 19, at the end of a five-day trial in which Gamsakhurdia and an associate, Merab Kostava, pleaded guilty to anti-Soviet agitation and propaganda.

Whitney quoted friends of Gamsakhurdia as saying they believed most of the 3 1/2 minute confession film was fabricated. Piper wrote that sources close to Gamsakhurdia said the confession was false. Gamsakhurdia witnessed the film in a darkened courtroom yesterday and said it was authentic.

Gamsakhurdia, 39, an avowed Georgian nationalist and son of a famous Georgian writer, in a clear and calm voice said it was "absurd" to claim the recorded confession a fake. He saw it himself when broadcast May 19, he said. "IUt corresponds with what I said."

Questioned by Skoredov, he denied telling anyone after the trial that he intended to continue his nationalist activities when released from five years labor camp and exile. He had spoken just to his wife about family matters, he said.

"I didn't say anything to my wife about the case because she knew all the truth. At the trial, I said my patriotic and humanitarian duties have nothing to do with anti-Soviet activities (which) I admit."

In Georgia, the word "patriotic" means pro-Georgian, anti-Soviet to many. The televised trial segment shown last night omitted this statement. When Gamsakhurdia was first convicted, his wife repeated a virtually identical remark he made to the court as proof that her husband intended to continue his dissdence.

Judge and prosecutor led Gamsakhurdia into an attack on Whitney's Times bureau chief in Moscow, David Shipler, who was covering the court hearing.

Gamaskhurdia said he was surprised to hear of a May 15, 1976 Shipler article quoting Gamsakhurdia as advocating u.S. military intervention to sever Georgia from the U.S.S.R. "A sensation, an obvious slander," he said. Shipler said he stands behind the article's accuracy.

Television cameraman Viktor Pavlov, the sole other witness, said he spent about seven minutes filming the Gamskhurdia confession may 11 in Tbilisi. The court film was the same sequence, he said. There were three detectable splices in the film.

Dissidents had told Piper the splices had indicated tampering. The sound track seemed synchronized with Gamsakhurdia's lips. Pavlov said the dissident knew there was a camera in front of him and was turned toward it. Some dissidents had suggested Gamsakhurdia had been filmed through a fake mirror.

Editor Lubovtsev, of medium build with thinning dark hair, wore an expression of puckered intensity through the hearing, squinting behind lightly tinted glasses at the lights, three television cameras, two Soviet movie vision cameras and ten Soviet cameramen ranged across the room from him.

Joining them were more than 30 Western reporters, specially invited by the press department of the Foreign Ministry. Such publicity at the hearing underscores the political nature of the proceeding in which the state seeks enormous publicity as it moves against the newsmen who have withdrawn from active participation.

Lubovtsev said "everyone" at Soviet television was "indignant" over the Whitney-Piper articles. "The slanderous fabrications and falsifications damage Soviet television and such defamation should be punished and Piper and Whitney made to apologize and publish a retraction. The articles don't correspond to reality."

His suggested retraction: "On May 25 there appeared a dispatch in our papers and now it appears it did not conform to reality." Soviet law provides for a 50-ruble ($72) fine if a retraction is not made despite a court order. Fines can total 300 rubles ($432).

The two dispatches, while entered into evidence, were never read in court. The judge, an older man with a long, stern face, read a recent Izvestia attack on Whitney headlined "Provocation instead of information" which criticized the reporter for a dispatch that quoted unformed sources as raising questions about the Soviet Union's intentions in strife-torn Rhodesia.

The prosecutor attacked another Whithney article dealing with alleged anti-semitism in the Ukraine. It related that a Jewish scientist was dismissed from his job after applying for an exit visa to Israel. He said a Novosti Press Agency reporter had looked into Whitney's account and found it false.

"It sounds like Whitney needed a case to fill his personal cynical needs. A person who pours barrels of black paint onto a foreing country is a speculative journalist, an irresponsible person," the prosecutor said.

The judge admitted both items into evidence.

But he ruled irrelevant a letter of complaint to the State Trucking Ministry Piper had written abour being overcharged for a shipment of goods. Skoredov said this showed Piper's "negative" attitude. Skoredov was allowed by Almazov to talk about the letter at some length in his summatin, complaining that in fact, "Piper was charged less than usual."

The case, he said, was a "logical continuation of their hostile and prejudiced attitude to Soviet reality." Piper, 39, has been here three years; Whitney, 34, for nine months of a three-year assignment.

Almazov and the assessors retired for less than a hour and returned to read a verdict that took up about four cleanly typedwritten pages. "Slander was distributed by the articles," Almazov declared. "It is clear. I find the appeal well-grounded, the publication defamed the honor and dignity of Soviet television."

He observed that the state publishing combine had assured the court that copies of the New York Times and The Baltimore Sun were easily available "at kiosks, hotels and by subscription" here.

He added that the reporters could have found out the truth of the confession by checking Tbilisi court records. "The court finds it's slander, deliberate distortion of Gamasakhurdia's testimony, fabrications of assertions. On all sides, there is guilt."