Foreign Secretary David Miliband has said that Britain would not pay a ransom for the hostages held by pirates off the east African coast.