David Cameron has been offered an olive branch over Britain's place in Europe by the leaders of Germany and Sweden after his defeat over the nomination of Jean-Claude Juncker as European commission president.

The prime minister was told by the German chancellor, Angela Merkel, that she was "ready to address British concerns", while Fredrik Reinfeldt, the Swedish prime minister, acknowledged that closer union was "not the best for everyone". Both countries backed the nomination of Juncker, who is thought to favour further European integration.

Reinfeldt referred to a document issued by EU leaders after they voted 26-2 in favour of the arch-federalist's nomination on Friday.

"Just look into what we have written in our conclusions," he told BBC Radio 4's Today programme. "You will find references with text, which I think is very important for David Cameron, saying this ever-closer union perception is maybe not the best for everyone." This had "never been stated" by the EU before.

Reinfeldt said he was willing to "walk the extra mile" to address Cameron's concerns over the EU.

Merkel, meanwhile, said she shared some of Cameron's concerns and promised a review of how the president is nominated, a process that normally requires consensus among member states.

"I have every interest in having the UK continue to be a member of the EU," she said. "The UK always has to take that decision itself but from a European perspective and a German perspective, I think this is most important and this is what I'm going to work on. We have shown very clearly that we are ready to address British concerns."

The Ukip leader, Nigel Farage, however, said the prime minister had no support from European leaders and that Cameron's defeat exposed his inability to renegotiate Britain's relationship with Brussels.

Farage said there was a mood within the EU that it would rather get rid of the "friendless" UK than allow it to start "picking apart treaties". He told Today that leaders viewed Britain as "a damned nuisance" that was always complaining.

He added that while Merkel said she would address British concerns, ultimately, when she "puts her foot down" everybody fell into line.

"She said countries can move at different paces, while some can get there more quickly than others, but she wasn't for a moment suggesting that Britain can opt out of the principle of an ever-closer union … What I saw yesterday was the prime minister utterly humiliated, looking like a loser who had learnt nothing, still insisting, though it's rather more difficult, that he can renegotiate our position. He can't.

"In terms of the fundamental changes that the British people really want in this relationship, namely, we want a trade deal and not membership of a political union, I would say this to you: the other European leaders and certainly the European parliament would rather the United Kingdom left the EU than start to pick apart the treaties because if they do that they know there'll be half a dozen other northern European countries that will demand the same."

But Margaret Thatcher's former press secretary Sir Bernard Ingham said he believed Cameron had increased his chances of winning the general election in 2015 by taking a stand, according to Associated Press.

"I think he's in a stronger position than he was yesterday," Ingham said. "He stood up for a principle. Yes, he was defeated, fine, but the rest of Europe has completely ignored the uneasy feeling the electorate has about Europe, as shown in the last election."

Cameron insisted he had taken "some small steps forward" by securing changes to the text of a document setting out the EU's strategic agenda for the next five years. Those changes make clear that the 28-nation bloc is ready to address British concerns about its future direction and accepts that its commitment to "ever-closer union" does not preclude individual members taking their own decisions on the pace of integration.

He said the result of the vote had been a "bad day for Europe" and he now faced an uphill struggle to keep Britain in the EU if his promised referendum on membership goes ahead in 2017.

The former defence secretary, Liam Fox, insisted the defeat had not weakened Cameron or Britain's role in Europe.

"The prime minister has shown Britain will not take a back-seat approach to reform of the European Union," he wrote in the Sun. "If Juncker represents an even more integrated EU, then the prime minister has shown he supports an agenda for reform."

The Labour party leader, Ed Miliband, said Cameron's advocacy had become toxic and Friday's events showed he could not represent Britain's interests in Europe.