Boris Johnson has hit out at "trivial" and "hysterical" questions about his personal integrity and ambitions to be prime minister.

In an interview with the BBC's Eddie Mair, a clearly uncomfortable Johnson was forced to deny being a "nasty piece of work" and refused to discuss allegations about his private life.

The intense exchanges came after the London mayor agreed to take part in an in-depth documentary about his life, due to be aired on Monday evening. Johnson suggested the journalist Michael Cockerell had effectively blackmailed him into participating.

"It is like when the News of the World ring up and they say listen, you are going to be in this story. You can either co-operate or not co-operate," he said. "I thought on the whole it was probably wiser, given that it was going to happen anyway, to try to say something rather than leave the field clear to put the boot in."

When Mair said he wanted to "talk about you", Johnson joked: "That's exactly what I am trying to avoid."

The mayor appeared thrown when Mair grilled him on his sacking from the Times more than two decades ago for making up a quote. "I mildly sandpapered something someone had said. It is very embarrassing, and I am very sorry about it," he said.

Mair, who is standing in for Andrew Marr on his Sunday morning show, pressed Johnson over whether he lied to the then Tory leader Michael Howard about allegations of an extra-marital affair in 2004, which resulted in his resignation as shadow arts minister.

"I never had any conversation with Michael Howard about that matter," Johnson said. "I do not propose to go into all that again. Why should I? I've been through it a lot. Why don't we talk about something else?"

Insisting that he was talking about integrity, Mair turned to a telephone conversation Johnson had in 1990 with one of his friends who was demanding the private address of a News of the World journalist. A recording of the call suggested Johnson had agreed to supply the details, even though his friend indicated he wanted to have the reporter beaten up for smearing his family.

Johnson said that "nothing eventuated" from the conversation, adding: "I think if any of us had our phone conversations bugged, people say all sorts of fantastical things whilst talking to their friends."

Mair said: "You are a nasty bit of work, aren't you?"

"All three things I would dispute … if we had a longer time I could explain that I think all three interpretations you are putting on these things are not wholly fair," an exasperated Johnson said.

Challenged to give a straight answer on whether he wanted to be prime minister, Johnson said: "What I want is for David Cameron to win this election, which he deserves to do. In these circumstances it is completely nonsensical for me to indulge this increasingly hysterical conversation … What I want is to spend my time remaining as mayor to do as well as I can as mayor of London.

"I think people would rightly conclude that I don't want to talk about this subject because I want to talk about what should happen, which is that the government deserves to win the next election.

"It is a measure of the trivialisation of politics that I thought I was coming on to talk about the budget and housing in London, and you have … I do not mind all these questions about other stuff, but I think it is more important that we look at the things that are happening now in the economy and what the government is doing to help."

Asked whether he would watch the documentary, Johnson said: "I'm certainly not, not after what you have told me. I am not going to watch it."