The UN security council has voted to increase an African Union peacekeeping force in Somalia to nearly 18,000 troops in a bid to defeat extremist rebels and help stabilise the country after more than two decades of chaos.

The vote to boost the Amisom force of east African troops came as a joint Ethiopian and Somali government offensive wrested control of the central city of Baidoa from the al-Shabaab rebels. It boosted hopes at a conference in London on Thursday aimed at consolidating the government in Mogadishu, bringing greater stability to the country, and combating piracy which has thrived on Somalia's lawless coastline.

Responding to a Guardian report that the British government had considered air strikes against the al-Shabaab militia, which has vowed fealty to al-Qaida, the Somali prime minister, Abdiweli Mohamed Ali, said: "Targeted strikes against al-Qaida in Somalia we would welcome. But we have to be sure we protect the lives and safety of Somali citizens."

Al-Shabaab militia have a strong presence in Somalia Graphic

The UK sponsored the security council resolution that increased the Amisom force and widened its mandate. Speaking after the vote, the British ambassador to Nato, Mark Lyall Grant, said: "For the first time it authorises Amisom to use all necessary means to reduce the threat from al-Shabaab, and therefore to conduct more robust and offensive operations."

The resolution also imposed a ban on the export of Somali charcoal, a principal source of funding for the rebels.

The Somali prime minister welcomed the UN security council vote, which puts Kenyan troops in Somalia under AU command, after Nairobi launched its own offensive against al-Shabaab bases over its northern border. They will fight alongside Ugandan and Burundian troops already in the AU force and a fresh contingent from Djibouti.

Amisom, which has been in the country since 2007, has scored a string of victories, taking Mogadishu last August and driving al-Shabaab fighters out of the centre and south of the country. Reports from Baidoa on Wednesday said that Ethiopian and Somali government tanks and troops had swept into the town, while the insurgents had melted into the surrounding forest.

Speaking in London on the eve of the conference, Ali said the long-term solution to Somalia's security problems was a robust home-grown army, navy and coastguard, and that the only enduring solution to the al-Shabaab insurrection and chronic piracy was economic.

"We must be ready to welcome and assist large numbers of defectors from the extremist ranks, and give them ways of making an honest living," Ali said. "The long-term answer to piracy lies inland. Its root causes are lawlessness and poverty. The opportunity cost for young Somalis to take to the seas is zero. Lots of lives have been lost and lots are in prison. We have to offer alternative livelihoods."

The Somali prime minister said he hoped the London conference, which will bring together about 50 governments and international organisations, would mark a tipping point in Somalia's fortunes.

"We expect this to be a game-changer for Somalia. These are the expectations of the Somali people. We think it will succeed," he said at a meeting of the International Institute for Strategic Studies.

David Cameron told parliament that the conference would seek to galvanise an international effort to transform Somalia.

"It means working with all the parts of Somalia, which has been more blighted by famine, by disease, by violence, by terrorism than almost any other country in the world, to give that country a second chance," the prime minister said. He argued there were already tentative signs of progress.

According to the European Union's naval anti-piracy patrols, pirates hijacked six vessels in the last six months of 2011, compared with 19 in the first four months of that year. Ransoms last year cost the shipping industry about £86m.

Perceptions of Somalia as an international case for intensive care were reinforced last year, when the UN declared famine in parts of Somalia, where a fierce drought on top of years of conflict between a weak transitional government and Islamist insurgents from al-Shabaab pushed the country over the edge.

Some tens of thousands of Somalis are estimated to have died, but the famine is now over, although 2.34 million people – a third of the population – remain in need of food aid and shelter, with 1.7 million residing in the southern regions controlled by al-Shabaab, which has blocked access for many humanitarian groups.

Iran, Qatar and Turkey are also active diplomatically in Somalia, with Turkey planning to hold a conference of its own on Somalia later in June focusing on humanitarian efforts.

In Somalia, efforts are under way under the auspices of the UN to draw up a constituent assembly, an independent electoral commission, a new federal structure and a smaller parliament with greater representation for women. The UN has tried to draw in all Somalis, including those from the semi-autonomous region of Puntland, although al-Shabaab, which has declared a formal alliance with al-Qaida, remains frozen out politically.

• This article was amended on Tuesday 13 March. The original caption for the map wrongly defined the al-Shabaab strongholds.