The U.S. president has announced restrictions on citizens from 12 countries in response to the terror attack in Boulder, Colorado.