Britain must be given the power to limit the number of migrants it admits as the price for staying in the European Union, Iain Duncan Smith says.