Here in the New Clubmoor Hall in Norris Green, Liverpool, they're selling Bateman's Light Dinner Ale at 6d a bottle. The reek of Nelson's Tipped and Senior Service cigarettes fills the air. Moody boys in slim suits and slick DAs mooch about the dancefloor. In front of them glamorous girls in pencil skirts and fitted jackets, their hair immobilised by spray, stare at the modest stage. Everyone is watching the boys in the group.

The teenage musicians are trying out their new guitarist. They first met him when they played at a church fête in nearby Woolton. The group's scowls – who was this young pretty boy? – had turned to smiles when he demonstrated a mean way with Eddie Cochran's Twenty Flight Rock. Pretty good for a left-hander. The kid was in.

Now, three months later, the group are ready to rock'n'roll for the first time. "Next, ladies and gentlemen," says the singer by way of introducing their new guitarist, "the Scouse Duane Eddy will play Movin' 'N' Groovin'."

It is 18 October 1957 and the Quarrymen are experiencing their first modest taste of fame. This new musical partnership, between 17-year-old John Lennon and 15-year-old Paul McCartney, might be on to something.

Over 50 years later, in April 2009, in a time-capsule Irish pub in the north-west London suburb of Sudbury Hill – standing in for the late 50s Liverpool social club – Sam Taylor-Wood is controlling the action on day 41 of the 45-day shoot for Nowhere Boy, the artist turned director's depiction of the early life of John Winston Lennon. The screenplay is by Matt Greenhalgh, writer of Control, the acclaimed biopic of Joy Division's Ian Curtis, and is adapted from the first half of the memoir Imagine This – Growing Up With My Brother John Lennon by Julia Baird.

It has been a fairly quick-fire shoot, with filming taking place here, in Pinner, in Liverpool and at Ealing Studios. There have been myriad period details to attend to, and not just the normal issues of accurate set dressing (the number of cars in the streets in the early 50s; the brands of beer the social club would sell) – because the producers know the eyes of legions of Beatles obsessives will be on them.

Did the earth move for Lennon when he heard Screamin' Jay Hawkins's I Put a Spell on You, a single he received from a "Cunard Yank" seaman down Liverpool docks, and if so, what label was it on? Did McCartney use his little finger to play the B7 chord? Would the Quarrymen have used Reslo microphones, and did the teenage Lennon favour a Zenith Model 17 guitar, the teenage McCartney a Gallotone Champion? (The answers: yes; Okeh; yes – after he got a bus across Liverpool to learn it; yes; no and no – it was the other way around.)

Ensuring the featured songs and the musical performances are accurate and credible has been another priority for the film-makers. "We took the decision early on," says producer Kevin Loader, "that you've got to cast the best actors you can find and then school them in the music." Thus 19-year old Aaron Johnson was given the lead role not because he was a Lennon lookalike or a natural-born rock'n'roller. "He came in to auditions and wouldn't engage," recalls Taylor-Wood. "He was very much in his own world. He had the right intensity."

Enter Nowhere Boy's music consultant Ben Parker. He started teaching the Buckinghamshire-born Johnson how to play guitar, sing and hold himself like Lennon last December. With the aid of vocal coach Penny Dyer, they worked on emulating Lennon's particular Scouse accent, then his singing voice – "John sang from the twang of his own speaking voice," says Parker, one of several self-confessed Beatles fanatics working on the production.

Eighteen months ago music supervisor Ian Neil began a "feasibility study" of the songs the soundtrack would need. He had 10% of the film's £6.7m budget to spend on securing the rights to the classic rock'n'roll tunes fundamental to the story. Could they use Chuck Berry's Guitar Boogie, part of the Quarrymen's repertoire? Would featuring Elvis Presley tunes bust the bank? And to what degree, exactly, should the music of Lennon and McCartney feature?

Little wonder the pressure is showing here on the fringes of London on this rainy spring day. "I'm going to need a stint in an opium den in Marrakech after this," sighs Taylor-Wood. "I need some heavy drugs to disintegrate everything."

She's joking, of course. A music fanatic who's made concert films for the Pet Shop Boys, a video for Elton John and a short film named after Buzzcocks' Love You More, she lobbied hard to make Nowhere Boy after being handed the script by her friend Joe Wright (director of Atonement). The 42-year-old director admits she's sad at the prospect of the shoot ending – and not just because, as it will later transpire, she has embarked on a relationship with her leading man.

Imagine that, an artist falling in love with Lennon. "I know, isn't it amazing?" says Yoko Ono when we speak a few months later. "It's not a fictitious situation," Lennon's widow says of Nowhere Boy, "it's very fateful."

How to depict a legend? How to cast fresh light on one of the greatest – and most over-analysed – musicians of the rock and pop era?

"There was a point where I suddenly felt, I'm in the middle of a hell of a lot of powerful people," remembers Taylor-Wood. She means Ono, McCartney and the other keepers of the Beatles flame (a young George Harrison also features in the film). "You think, 'Oh dear God, I've just taken on one of the biggest icons in the world,'" she continues. "It's a real person. The family are still here. I want to make this as sensitive to all of them as possible. How am I going to do this without upsetting one of them?

"So I did have a moment where I just thought, 'I don't know if I can do this.' Then I got in the car and turned the ignition on and Lennon came on the radio and I thought, 'OK I'm doing this.'"

The song was (Just Like) Starting Over.

Nonetheless: what new was there to say? Taylor-Wood, a first-time feature film director, answers by saying what she wanted to avoid.

"I didn't want to make a biopic. I didn't want to do the birth and the launch and the beginning. That wasn't interesting to me. It was really the story of this relationship between these two women and how they fed into Lennon's imagination and his music. The powerful influence that these really strong women had on him."

"These two women" are Lennon's mother Julia and his Aunt Mimi, who raised him as her own. Free-spirited Julia (played by Anne-Marie Duff) had a chaotic life: John's father was away at sea for much of the Second World War, and he remained largely absent after it; during the war Julia fell pregnant to another serviceman; then Julia met a third man (played by David Morrissey) and bore him two daughters. Prim and proper sister Mimi (Kristin Scott Thomas) felt this was no environment for a young boy and "stole" John to live with her (at her house, Mendips, now a National Trust property donated to the nation by Yoko Ono).

In the film we see Julia wheeling back into John's life when he's 15. He's dazzled by this glamorous woman he has to see behind his auntie's back. Julia takes him to Blackpool on a day out, introduces him to rock'n'roll via Presley's Teddy Bear, teaches him how to play the banjo and explains that rock'n'roll means sex. Several scenes allude to the son's Oedipal feelings for his mother, a controversial line taken in Philip Norman's recent biography, John Lennon: The Life, but not, unsurprisingly, in Lennon's sister's book.

"I didn't want to overplay that sexual stuff," says Matt Greenhalgh, "but here's a boy at 15 who was raging, as boys do at that age. And he meets this amazing, beautiful woman that he doesn't really know. OK, she's his mother but she still lights up his world."

What similarities – if any – does the screenwriter see between his depictions of Lennon and Ian Curtis, troubled and ultimately tragic northern icons both? "It's people trying to find love through becoming artists. A need to be loved. But whereas I love Control for its darkness, Nowhere Boy is about the joy of rock'n'roll. It's all about love and sex. That was new to the world in the mid-50s, so there's a liberating feeling about Nowhere Boy."

Indeed there is. The film is affectionate, tender, moving, and not afraid to show the darker side of Lennon's personality. But it also explains where those shadows come from. We see the building blocks of the man and his music – how Lennon's world and imagination open up as he reconnects with his mother, and how he connects with the exciting and visceral new world of rock'n'roll. To fully lay bare the latter, the film's music team put in serious legwork.

John Gosling, the music director, enlisted session musicians who would be good enough to evoke the amateurish performances of the young Quarrymen – the actors would then mime to these backing tracks. He and his team hired in vintage kit to purposefully hobble the accomplished players. Engineer/producer Emre Ramazanoglu tracked down five Reslo mics, popular in the 50s – "they were our secret weapon," says Gosling, "although they required a lot of soldering." His session musicians had to convey the teenagers' progression, from skiffle merchants to nascent rock'n'rollers, from Quarry Bank school to bedroom to Percy Phillips's rudimentary studio, where the Quarrymen recorded their only disc, In Spite of All the Danger/That'll Be the Day.

Tragically, just as he found her, Lennon lost his mother – Julia was killed by a speeding car on 15 July 1958. Lennon was 17. The only non-contemporaneous song of his that Taylor-Wood wanted to use was the obvious one, Mother, written in 1970 ("You had me but I never had you…"). Without it the film would lack its climactic, devastating emotional punch.

"To get that I had to get Yoko's approval of the film," says Taylor-Wood. Ono, who had given the film the go-ahead, maintained her distance during filming. But the director kept her appraised of progress with email updates (she also emailed McCartney regularly with fact-checking queries – "would you have said group or band?").

In early September this year – the film was completed to an incredibly tight schedule in order for it to appear as the Closing Gala feature at last week's London Film Festival – Taylor-Wood sent the near-finished film to New York. "I didn't want to go myself, sit outside the room waiting for Yoko's reaction. But immediately after she saw it she sent me a very, very beautiful letter saying how much she liked it and saying she would give us permission to use Mother. That was a major moment of relief!"

A film that was kickstarted by (Just Like) Starting Over had its climax. And there was a final moment of serendipity. Taylor-Wood finished it, tweaking a final sound level, on 9 October: birthday both of John and his and Yoko's son Sean.

Nowhere Boy is brilliantly evocative and provocative, and no one is more pleased than Yoko Ono. "First of all, it is a very difficult subject because so many people think that they own John and have their own version of John. So Sam was very brave. But also she did the right job."

What does Greenhalgh want people to get from the film?

The writer pauses. "That Lennon didn't have it easy," he says. "There's a lot of issues that obviously were still going on in the Beatles and later on – which, once you piece them together, this is the final piece of the jigsaw. You understand why he was how he was. His anger, and in some way neediness. It was all down to what happened to him in childhood. It's all very Freudian."

For Aaron Johnson, who is excellent at evoking Lennon's coolness, cockiness and feelings of grief, Nowhere Boy pierces the heart of an artist who, since his death in 1980, has been enveloped in fact-obscuring idolatry and conjecture. In the year running up to what would have been John Lennon's 70th birthday, Nowhere Boy shows us something of the essence of the man.

"After his mum's death I don't think he ever found love until Yoko," says the actor born a decade after Lennon's murder. "It kind of destroyed him and he kept that in. He'd opened up his heart so much that when she did die he had to go back to his roots – how Aunt Mimi taught him: to seal it all in."

Producer Kevin Loader points out how "self-conscious Lennon was about how he presented himself later in life". It all stems back to those Liverpool streets, those women, that loss.

"John Lennon was already an artist and a poet," reflects Johnson. "But he didn't know how to express it until his mother came back into his life. It was rock'n'roll, it was danger and sex and violence and poetry."

Nowhere Boy opens in cinemas on 26 December