JUST over 20 years ago the foreign secretary, Douglas Hurd, declared that Britain should aim to “punch above its weight in the world”. Today the country seems reluctant even to enter the ring. A recently retired British NATO chief, speaking of Russia and Ukraine, has complained that the prime minister, David Cameron, has become a “foreign-policy irrelevance”. America despairs of Britain’s shrinking armed forces and criticises its “constant accommodation” of China. Allies are worried, opponents scornful.

The country’s politicians, who are fighting to win a general election on May 7th, appear unbothered by the world’s sneers. That is a mistake. Britain’s diminishing global clout is a big problem, both for the country and for the world.

The uses of abroad

As a largish power in relative decline, Britain has a tendency to veer between hubristic intervention abroad and anxious introspection at home. After Tony Blair’s expeditionary misadventures in Iraq and Afghanistan, the Conservative-Liberal Democrat coalition was always going to shun grand schemes. But Mr Cameron has been not so much cautious as apathetic, ineffective and fickle.

The prime minister made a brave and passionate case for armed intervention in Libya against Muammar Qaddafi. But he did not reckon for the day after and the country is now in a state of civil war. He led America to think Britain would support it in bombing raids against Syria, but then bungled the parliamentary vote. Though Britain was one of the moving forces behind the 1994 Budapest memorandum, which supposedly guaranteed Ukraine’s security when it gave up its Soviet-era nuclear weapons, Mr Cameron has been almost absent in dealing with Russian revanchist aggression against it. Last year, as host of a NATO summit, the prime minister urged the alliance’s members to pledge at least 2% of their GDP to defence. Just months later a straitened Britain looks poised to break its own rule.

In Europe the promise of an in-out referendum if Mr Cameron wins the election has made Britain seem semi-detached. But rather than counteract that impression through vigorous diplomacy, the prime minister has reinforced it. In European Union summits he has been underprepared and overambitious. His humiliating attempt to block Jean-Claude Juncker from becoming president of the commission left him with only Hungary for company. Pulling the Conservatives out of the EU’s main centre-right political group has had the unintended effect of cutting Mr Cameron out of vital discussions with other centre-right leaders, such as Germany’s chancellor, Angela Merkel.

It is hard to be more optimistic about a Labour government. Ed Miliband, the party’s leader, is pro-European, but he has no more feel for American foreign policy than Mr Cameron does. He apologises for Labour’s interventionist history so strenuously and unreservedly that he leaves no room for liberal intervention. Disastrously, a Labour government might well be propped up by the Scottish National Party, which wants to scrap the submarine-based nuclear-missile system that is a pillar of Britain’s relations with America and NATO.

Mr Cameron’s defenders say that Britons are war-weary and impoverished. But Mrs Merkel and François Hollande, the French president, have shown that you can have an active foreign policy while dealing with an economic crisis.

Just now liberal values and international co-operation especially need defending. New emerging powers, particularly China, want a say in how the world works. By seizing Crimea and invading Ukraine, Vladimir Putin’s Russia has challenged norms of behaviour that were established after the second world war. If Britain does not stand up for its values, it will inherit a world that is less to its liking.

And Britain is well placed to make a difference. With a great diplomatic tradition, a permanent seat on the UN Security Council and strong, if fraying, ties to both Europe and America, Britain ought to be pushing hard to extend open trade, human rights and international law as well as newer agendas against crime, terrorism and climate change.

To make its voice heard, Britain needs to bulk up its diplomacy and its armed forces. Pledging to spend 2% of GDP on defence may seem arbitrary but it is a crucial signal to America and other countries that Britain is prepared to pull its weight in exchange for NATO’s guarantee of joint security. That makes more sense than the commitment (which both Mr Cameron and Mr Miliband cherish) to spend 0.7% of GDP on foreign aid. The money can, and should, be found.