David Cameron is to urge Barack Obama to pressure internet firms such as Twitter and Facebook to do more to cooperate with Britain’s intelligence agencies as they seek to track the online activities of Islamist extremists.

As he becomes the first European leader to meet the president after the multiple shootings in Paris last week, the prime minister will seek to win Obama’s support for his plans to secure a new legal framework to deny terrorists a “safe space”.

The prime minister arrives after he proposed earlier this week that British intelligence agencies have the power to break the encrypted communications of suspected terrorists and insisting that the likes of Twitter and Facebook do more to cooperate with Britain’s GCHQ eavesdropping centre.

Cameron will demand that US internet companies store – and then be prepared to hand over – data and content needed by the intelligence agencies “to keep us safe” when he meets the president for talks in the Oval Office on Friday morning.

A government source said: “The prime minister’s objective here is to get the US companies to cooperate with us more, to make sure that our intelligence agencies get the information they need to keep us safe. That will be his approach in the discussion with President Obama – how can we work together to get them to cooperate more, what is the best approach to encourage them to do more.”

Obama, who recently accused North Korea of orchestrating the cyber attack on the film studio Sony Pictures, is due to address data security in his penultimate state of the union address next week.

The sought-after summit meeting is Cameron’s last bilateral visit overseas before the general election. The prime minister arrives on Thursday, and is due to first meet the president for dinner at the White House.

The two-day visit, designed originally by Downing Street to provide helpful general election pictures to burnish Cameron’s status a world statesman, will take on a more sober note than planned in the aftermath of the attacks in Paris. The White House believes it erred in failing to send a high-level representative to the Unity rally in Paris on Sunday attended by Cameron and other EU leaders.

In a sign that Obama is prepared to go out of his way to help the prime minister on the eve of the general election, the two men have penned a joint article in which the two leaders declare that transatlantic freedoms are “rooted in economic strength”.

Echoing one of the Tories’ central themes of the general election – that progressive goals, such as defending the NHS, cannot be achieved without a sound economy – Cameron and Obama write in the Times on Thursday: “As we meet today at the White House, we reaffirm our belief that our ability to defend our freedoms is rooted in our economic strength, and the values that we cherish – freedom of expression, the rule of law, and strong democratic institutions.”

The intervention by Obama, who also endorses Cameron’s plans to expand the number of apprenticeships and to increase the minimum wage, will come as a blow to Ed Miliband, the leader of the Democrats’ sister party in the UK. But the Labour leader, who met Obama in the White House last summer in a more low key setting, has been told that the president was unamused by his decision not to support Cameron in the House of Commons vote on military action in Syria in August 2013.

While in Washington, the prime minister will:

• Press the president to allow Shaker Aamer, the last British resident held at Guantánamo Bay, to be released and sent to Britain. Officials fear that Aamer, a British resident who was born in Saudi Arabia and who has been held at the US base since 2002, will not be safe if the US carries out a plan to deport him to Saudi Arabia.

• Announce business deals worth more than £1.1bn including an injection of £600m in equity capital by the Carlyle Group into the North Sea oil and gas industry.

British government officials say that the prime minister’s plan to provide a fresh legal framework for the collection of communications data – such as billing information – and the interception of the contents of communications can only work with the co-operation of internet giants that are largely based in the US.

Sir Nigel Sheinwald, the former British ambassador to Washington who has been appointed as a special envoy to the internet companies, is due to report by the end of March.

But a government source indicated that the prime minister believes that the internet giants need to do more now – a process that could be encouraged by Obama.

Obama has faced intense pressure from the internet giants over the intrusive surveillance of the US National Security Agency exposed by the files leaked by the whistleblower Edward Snowden.

Mark Zuckerberg, the founder of Facebook, wrote on his Facebook page last year that he was “confused and frustrated by the repeated reports of the behaviour of the US government”.

The president announced a series of initiatives on Monday, before his state of the union address, to improve the data security of US citizens. A new student digital privacy act is designed to stop companies from selling student data to third parties.

Theresa May, the home secretary, told MPs that there must be no safe spaces for terrorist communications was likely that the counter-terrorist investigation in Paris following the massacre at Charlie Hebdo involved the use of communications data to locate the suspects. The home secretary mounted another fierce attack on her coalition colleagues for blocking the communications data bill – the so called ‘snoopers charter’ – in 2012, saying: “With every day that passes without the capabilities in the proposed bill, the powers of the security services diminish.” She said this meant “crimes will go unpunished and innocent lives put at risk”.

She said it was necessary to allow the police and the security services, under a tightly controlled regime, to find out “the who, where, when and how of a communication, but not its content”.

The prime minister will use the White House talks to press the case for the release to Britain of Shaker Aamer who has not been charged with any offence despite being incarcerated in Guantánamo Bay since 2002 after being picked up in Afghanistan in 2001 where he said he was working for a charity.

Cameron, who raised the case of Shaker Aamer at the G8 summit in Lough Erne in 2013, is keen to secure the release of the detainee to avoid him being sent to Saudi Arabia. Officials point out that the UK has taken 14 Guantánamo detainees compared with 11 across the rest of the EU.

“This is an important case for the prime minister and he would like to see progress on it as quickly as possible,” the government source said. “The opportunity that this presents, in terms of Shaker Aamer’s case, is for the prime minister to sit down face to face with President Obama and talk to him about it and talk to him about it and understand where the US is at.”

However, the prime minister does not expect a breakthrough on Aamer during this trip. He appreciates he needs to make the case with care because the US Congress has to be given 30 days’ notice of any release from Guantánamo.

Congress could also disrupt Obama’s plans to close the Guantánamo Bay detention centre by the end of his second term if a release plays badly in the US.

It is understood that Britain has been unable to provide the US authorities with assurances that it would have a legal basis for monitoring Aamer on his return to the UK.