Billy Cunningham yesterday signed a three-year contract with the NBA champion Philadelphia 76ers--estimated not at $300,000 but close to $400,000 a year; that, said team owner Harold Katz, makes his coach the highest paid in the league, maybe in history.

Cunningham, 40, said he "sincerely" had been thinking of retiring after the 76ers won the title, but Katz "was very flexible. He was willing to let me clear my head. And I decided to come back." And, said the NBA's most successful coach, "I decided I was ready to make a commitment to see a better basketball team."

Cunningham's old contract, for $200,000 a year, expired May 31, the night the 76ers defeated the Los Angeles Lakers for the title. Before he struck his deal, Hubie Brown was about to become the highest paid NBA coach, $300,000 from the New York Knicks . . .

Two of the reasons Cunningham may have decided to return, center Moses Malone and forward Julius Erving, are on the official league all-star team chosen by a nationwide panel of media members. With them on the first team are Boston Celtics forward Larry Bird and guards Earvin (Magic) Johnson of the Lakers and Sidney Moncrief of the Milwaukee Bucks. Bird, a first-teamer all of his four NBA seasons, was the only player chosen on all 75 ballots and landed 149 of 150 points; Malone 147 . . .

Guard Paul Westphal, NBA comeback player of the year '82-83, has been cut by the Knicks, apparently victim of the salary cap imposed by new collective bargaining agreement.

"Paul made a solid contribution . . .," said Coach Brown. "Athletic talent is only part of the equation. In putting Paul on waivers, we also had to consider the mathematics as well as the years of a contract."

Westphal, now a free agent again, averaged 10 points a game last season, leading the team in assists with 439. Before joining the Knicks as a free agent in March 1982, he played for the Phoenix Suns and Seattle SuperSonics, a first team all-star in 1977, '79 and '80.