Prime minister says payouts fund terrorism, as he tries to find a way to save captured British aid worker David Haines

An exasperated David Cameron lectured fellow world leaders on Thursday night telling them not to succumb to Islamic State's ransom demands, as he warned at the Nato summit in Wales that such payouts merely funded more terrorism against the west.

Cameron's message came at a conference dedicated to building a resolute international alliance against terrorism in the Middle East, and as he agonised over how to rescue the captured British hostage and aid worker David Haines.

Referring to a statement signed by the G8 last year opposing ransom payments – which apparently has been breached in some cases – Cameron said: "What matters is not your signature on a declaration, but not letting money be paid to terrorist kidnappers because that money goes into arms, it goes into weapons, it goes into terror plots it goes into more kidnaps.

"It is utterly self defeating. It is worse than self defeating, it is actually a risk to us at home."

Cameron made several public statements on the issue but was known to have raised the subject directly with the Nato leaders at a working dinner.

The prime minister chose not to publicly single out particular countries for criticism, but he is known to be angry that as many as three EU countries, including France, Spain and Italy, have broken the spirit of the G8 statement.

He condemned governments that chose to pay ransoms, saying: "I am in no doubt that those countries that have allowed ransoms to be paid, that has ended up with terrorist groups – including this terrorist group – having tens of millions of dollars that they can spend on kidnapping other hostages, on preparing terrorist plots, including against us here in the UK, and in buying arms and weapons to wreak havoc."

Aware that his stance might be seen as hardhearted he said: "I know it is difficult to hear and I've thought about this very carefully, but I'm absolutely convinced that the policy of not paying ransoms to terrorists for kidnaps is right."

And he hinted that Britain, probably through intermediaries, was trying to find a way to negotiate the release of Haines without having to offer any cash to the kidnappers. "It is an absolutely dreadful situation when this occurs and I want people to know that we do everything we possibly can," he said.

Haines, a Scots aid worker, who has two daughters, aged 17 and 4, is under threat of death from the hands of Islamic State. He appeared at the end of the video which showed the murder of his fellow captive, Steven Sotloff. Haines was captured last year at the Atmeh refugee camp in Syria's Idlib province near the border with Turkey. The camp holds more than 30,000 refugees.

He was kidnapped along with a fellow aid worker, Federico Motka, an Italian. Both men had been working for the French aid organisation Acted, assisting refugees in the north of the country.

Motka was set free last May, raising questions as to why Islamic State militants chose to free him and keep Haines. Since then, two further Italian aid workers have been kidnapped in the country.

It is thought that as many as two dozen westerners, mostly aid workers and journalists, are being held by opposition groups in Syria. Hundreds of Syrian civilians are being held by the same groups, while human rights groups estimate that tens of thousands have been detained by the Syrian government.

Downing Street believed it had secured an agreement last year during the UK's presidency of the G8 which meant the group's members would not pay ransoms to terrorist kidnappers.

More than 150 people had been kidnapped by terrorists over the previous five years, 13 of whom were British, and the UK government estimated that terrorists and other extremist groups had collected at least $60m in ransom payments over that period.

Since last year's G8 summit in Northern Ireland a number of Europeans have been released by opposition groups in Syria, which have included Islamic State, and although the governments of the freed hostages have routinely denied handing over payments, those denials are not always fully accepted in Whitehall.

Two Spanish and four French journalists have been released this year; after the four Frenchmen were set free there were reports in the German media that $18m had been paid, although this was denied by the French government.

A German national was released by Islamic State in June, and although his government denied paying any ransom, German media reported that an unspecified inducement had been offered.

Last month the US government denied paying any ransom during the Qatar-brokered deal to release Peter Theo Curtis, an American journalist held for 22 months by Jabhat al-Nusra, al-Qaida's affiliate based in Syria.

Four months ago, four French journalists held in Syria by Isis were freed after, it was claimed, François Hollande's government paid a hefty ransom.

The reports were quite detailed; the defence minister, Jean-Yves Le Drian, it was said, had personally carried the cash to the Turkish capital, Ankara.

The claim was denied by the Élysée palace, which argued that "Hollande has said it is a very important principle that hostage-takers should not be tempted to take others".

A month before, two Spanish journalists were also freed by Isis. On that occasion, a foreign ministry spokeswoman in Madrid refused to comment on whether money had changed hands. Her government, she stressed, uses "maximum discretion" when dealing with kidnappings.

Senior French ministers, such as Laurent Fabius, were seen on the tarmac in the Niger capital Niamey to welcome four employees of the nuclear firm Areva, who had been held captive for three years. At the time the Élysée was forced to deny that a ransom of €30m was paid.

Meanwhile, latest figures released by the Crown Prosecution Service show that six people have been convicted in the UK of Syrian-related terrorism offences since the conflict began and a further 11 are awaiting trial in British courts.

The figures released Thursday reveal how the criminal justice system is facing a rapid increase in the number of terrorism cases in response to the surge in numbers of those joining Islamist groups in Syria.

Several hundred people are believed to have gone to Syria from the UK since the uprising against Bashar al-Assad began in 2011. The Metropolitan police revealed that 69 individuals were arrested in the first six months of this year in connection with illegal activities in Syria, compared to only 25 people in the whole of 2013.

Despite the surge in Syria-related terriorism, there was an overall decline in the number of people arrested for terrorism offences in the year to March 2014 – 230 compared with 252 in the previous year.