James Franco seems to be everywhere these day in all kinds of different guises. He is a movie star, soap-opera actor, author, director, Yale PhD student, drag model, performance artist, 2011 Best Actor Oscar nominee. Yet even with this eclecticism, the 32-year-old's casting as Allen Ginsberg - the gay Jewish Beat poet who helped lay the foundation for '60s counterculture in America - appears at first glance to be somewhat counter-intuitive.

Franco, who broke through internationally playing Harry Osborn in Sam Raimi's Spider-Man trilogy, admits that he was surprised when the director Gus Van Sant handed him a screenplay for the film Howl, by writer/directors Rob Epstein and Jeffrey Friedman (makers of The Celluloid Closet, an acclaimed documentary about Hollywood's treatment of homosexuality on film).

He had actually been a fan of the Beat generation ever since friends at his high school in Palo Alto, California, turned him on to them at age 15. "When I started acting, I thought it would be great to do a movie about them," he says.

However, Franco always imagined himself playing one of the hipper Beats, like Jack Kerouac, author of On the Road, or his womanising buddy, Neal Cassady. "I never, ever thought I would play Allen Ginsberg . . . I was very, very surprised. And very interested. But I think I had a moment where I just had to consider, 'Okay, I'm very honoured. But can I do it? Am I really the right person?'"

Franco had good reason to wonder. Photographs of Ginsberg from around the mid-'50s period during which Howl is set, reveal a nerdy-looking figure in thick-rimmed glasses, while the actor has the kind of matinee idol looks that have recently seen him cast as Julia Roberts' love interest in Eat Pray Love, and as the face of Gucci men's fragrance line. You could, arguably, imagine the young Woody Allen as Ginsberg, but Franco?

Coincidentally, at the same time as he received the script, Franco was hosting Saturday Night Live for the first time. Their make-up department had just won an Emmy, he says, "so I brought in a picture of Allen Ginsberg and I said, 'If I were going to do a sketch about Ginsberg on your show, how would you make me look like this?' And they said, 'Well, it wouldn't be that hard. We would just comb your hair in a certain way and give you the right glasses. Your colouring is very similar, it's just the nose is a little different and his ears stick out a little more than your ears. So we'd push that a little bit, maybe.' And they were right." He told Epstein and Friedman. "They liked the ears idea. At first we just used putty and then they made some prosthetics" and the process started.

The film revolves around the obscenity trial in America that resulted from the publication of Ginsberg's groundbreaking epic poem, Howl - a celebration of the Beats and an anguished, rebellious fusillade of frankness in the face of repressive attitudes towards homosexuality, among other things, and the forces that alienate people from themselves. The film gives us versions of the poet before and after the poem was written, as well as recreating its first reading at Six Gallery on Fillmore Street, San Francisco, in 1955. Beautifully drawn animated sequences visualise Franco/Ginsberg's words in sequences which, the film's makers acknowledge, offer just one version of the poem's meaning.

Writing Howl was an act of liberation for Ginsberg, who growing up was, as Forward.com's Jay Michaelson put it, "the Jewish Every-teen, a middle-class boy in New Jersey indistinguishable from thousands of others like him". His plan upon enrolling at New York's Columbia University was to become a lawyer. The Ginsberg of the pre-Howl flashbacks in the film is therefore different to the one giving the reading, and the one being interviewed by a journalist in 1957.

"After doing research about his young life," says Franco, who listened to every reading of Howl he could find, "and everything he went through up until the publication of Howl, he was a very confused and insecure young man.

"He was growing up in the '40s and '50s. He was gay, there were no real public role models around for that kind of lifestyle, and in addition to that there were extreme societal pressures; people were being treated in institutions for being gay. He was expelled from Columbia in part for being gay [he slept with Kerouac], and it must have been very, very hard for him."

By eliding the line between the public and the private self in Howl, Ginsberg freed himself; he became more comfortable in his own skin and more confident.

If the poet's Jewishness set him slightly apart from the other Beats, who occasionally mentioned it, Ginsberg himself did not really address the topic in his work until later, in poems such as Yiddishe Kopf and Kaddish, the latter written for his mother, Naomi, who died in a mental institution and was denied a reading of the Kaddish at her funeral for want of a minyan. As for Franco, though his mother, Betsy, was Jewish, his upbringing was largely secular.

"I do feel like I missed out on the Jewish experience," he told Amy Raphael in 2009. "My Jewish friends tell me not to worry… but I like the idea of religion as a source of community."

That same year, Franco experienced a spoof barmitzvah when he was voted Man of the Year by Harvard University's venerable Hasty Pudding theatrical company (think a kind of American Cambridge Footlights). The fake ceremony reportedly featured a Rabbi Spider-Man and Yentl Express dancers who danced in drag to Havah Nagila.

"I don't know if this counts in rabbinical law," Franco quipped, "but if it doesn't, I do plan to have a barmitzvah."

In the meantime, he has another ceremony to think about: on February 27, he will co-host the Oscars with Anne Hathaway, putting him in the unusual position of being both a compère and a nominee for his performance as Aron Ralston, the outdoorsman who escaped from a canyon by cutting his arm off, in 127 Hours.

Whether he will also add Oscar winner to his other roles that night, only time will tell.