Prime Minister David Cameron says sorting out the problems of terrorism, piracy and famine in Somalia is in everyone's interests.