Foreign Secretary David Miliband has welcomed news that Iran has freed five British yachtsmen detained in its waters.