Actor and activist Sir Ian McKellen has spoken of how progress in gay rights has allowed him to come out and feel accepted, and says that aged 73 he is as content with life as he has ever been.

Sir Ian told the Radio Times that when he started out as an actor in his early twenties he lacked self-confidence, partly due to his sexuality.

“One of the reasons I became an actor was because I wasn’t self-confident,” he said.

“That was compounded by the fact that being gay was illegal in this country until I was 28 years old. That doesn’t do much for your self-confidence.”

He added: “Now I’m in a country where the laws don’t discriminate any longer. I feel accepted and about bloody time, frankly. That – plus the fact that I’m still working and still have my health – means I’m as happy now as I’ve ever been.”

In an interview last year, Sir Ian spoke of how difficult it had been growing up while homosexuality was illegal: “There was nothing positive about homosexuality in the newspapers and it was against the law to make love. I knew people my age who’d been sent to prison for doing it! When I tell schoolchildren that, they can’t believe it.”

Sir Ian still has an active working life, and will star in an upcoming sitcom on ITV from 29 April, which is set to feature him alongside Sir Derek Jacobi as an elderly gay couple.

The series, titled Vicious, will feature both actors as an elderly gay couple living in London’s Covent Garden.

Although still in good shape, Sir Ian said he was more aware of his own mortality now. In December he revealed that he had been living with prostate cancer for several years, but said that thanks to early diagnosis it was “no big deal”.

“Do I think about death? Yes, every day. People of our age, when we get together, talk about decrepitude all the time. We know we’ve got our lives behind us now,” he said.

“Friends keep dying, or get very ill. I’ve got a lot of young friends – that’s how I bolster myself against the inevitable.

“I’ve just arranged my house so that I’ll still be able to live in it when I can’t walk, so now there’s a lift in it.”

A patron of anti-homelessness LGBT charity the Albert Kennedy Trust, Sir Ian appeared at their fundraiser in March and said “cruel” religious leaders should feel responsible for gay teens living on the streets.

Earlier this month he said Baroness Thatcher “misjudged the future” with her support for Section 28, following her death on 8 April.