WASHINGTON (AP) _ United Press International said today that its two owners and the management team headed by Luis Nogales had agreed to end their public dispute and cooperate in seeking a buyer for the wire service. Nogales is to remain as UPI chairman.

The news agency said the agreement was reached during a nine-hour meeting Thursday at the offices of William White, the federal bankruptcy trustee assigned to the UPI case.

The wire service filed April 28 in Washington for protection against creditors under Chapter 11 of the federal bankruptcy code.

A UPI news story about Thursday's agreement, quoting unidentified ''sources close to the negotiations,'' was transmitted to its subscribers this morning. A copy of the story was read to The Associated Press by UPI spokesman David Wickenden, who refused comment on its contents.

Dan Carmichael, secretary-treasure of the Wire Service Guild who said he attended the meeting Thursday, told the AP:

''Everyone agreed that although we have divergent interests, we have to row this boat together or there will be no boat to row. It was an attempt to get everyone to stop sniping at each other and save this company.''

The UPI story said the meeting was attended by company co-owners Douglas Ruhe and William Geissler, their lawyers and lawyers for UPI managers.

Carmichael said the all-day meeting, which took place in White's offices in suburban Alexandria, Va., also was attended by Nogales and UPI president Raymond Wechsler, Carmichael and William Morrissey, president of the guild, White and Jules Teitelbaum, counsel for the committee of UPI creditors.

The guild represents about 900 UPI editorial employees.

Carmichael said that under the agreement, Ruhe and Geissler would drop their lawsuit in Chancery Court in Wilmington, Del., seeking court approval of their recent firing of Nogales as chairman of Media News Corp., the Delaware- based parent corporation of UPI. Ruhe and Geissler own 83 percent of the stock of Media News.

The judge in that case issued a temporary restraining order May 10 removing Nogales and two other officials from the Media News Corp. board. Lawyers for the co-owners and for UPI said the judge's order did not affect Nogales' management of the wire service.

Carmichael said the agreement Thursday left ''Nogales clearly in charge in the ordinary course of business'' at UPI. He added that the bankruptcy court ''would decide anything that is extraordinary,'' such as a move to sell the company.

The UPI story said that since the bankruptcy protection filing, Ruhe and Geissler had announced they were ''close to a deal to sell the wire service.''

At the same time, Nogales and Wechsler had met independently with numerous potential buyers, the story said, adding that Wechsler said this week that a number of ''credible prospective purchasers'' had expressed interest.

''But some potential investors have expressed confusion about which group to negotiate with, and others said privately they are reluctant to deal amid the public bickering, company sources said,'' according to the UPI story.

The story said UPI attorney Richard Levine will draft a formal outline of the agreement for presentation to the bankruptcy court. Carmichael said it would be in the form of a consent decree, and probably would be filed with the court early next week.

Carmichael said that under the agreement, a central investment banker or group of bankers would be designated to receive any offers to buy the company.

Nogales and Wechsler met Wednesday with executives of Reuters, the British news service, for what a UPI spokesman said later were ''purely exploratory and preliminary'' talks.

Neither UPI nor Reuters would comment on reports that the British news agency had made an offer to purchase UPI. Wickenden, the UPI spokesman, said he knew of no further meetings scheduled with Reuters.