Comedian Jay Leno, a frequent guest on NBC's "Late Night With David Letterman," has signed a "multiyear" contract with NBC to do specials, guest appearances and a weekly variety series.

The pact, announced yesterday in Burbank, Calif., calls for three late-night Leno specials during the '86-'87 season and a weekly prime-time variety series the following year. In addition, an NBC spokesman said Leno may join the list of guest hosts for Johnny Carson when the star is away from his "Tonight Show" desk.

Would that put Leno in the running to replace Carson when he leaves the show? "It's too early to talk about that," the spokesman said.

Leno, 36, asked to describe the deal in specific financial terms, said from Burbank, "It's all a big pyramid scheme. I'm working with the Amway people on this." He was kidding. The number of years in the contract is unspecified, he said, because he thinks "they'll keep me around as long as I keep rolling sevens" and not a minute longer.

The late-night specials, to air in the "Saturday Night Live" time slot when that show takes a week off, will be taped in such cities as Pittsburgh and Boston, the Boston-born Leno said, perhaps in the style of his recent "Jay Leno and the American Dream" special on Showtime, a pay-cable network. The program combined Leno's popular stand-up comedy routines with impromptu bits filmed on street corners, in classrooms and at bars.

"We're going to try to keep guest stars to a minimum," Leno said. "You can get real people to do stuff just as funny." Would Letterman be a guest? Leno seemed to gulp when he heard the question, then paused, and said nervously, "I'd love to have Dave on the show if he'd do it."

The contract also calls for Leno to make guest appearances on other NBC programs next season. "Maybe I'll be a funny drug dealer on 'Miami Vice,' " Leno speculated. "I will do 'All Is Forgiven,' " he declared, referring to an NBC series that has been canceled. Then he said he expects NBC to bring back such long-gone flops as "The Baileys of Balboa" into which he will be electronically inserted.

Would he appear on "Gimme a Break" with Nell Carter? "I'll have to watch the show sometime and see," Leno said.