The secretary of the Department of Homeland Security said Tuesday that “extreme vetting” for travelers to the United States could include recording the websites they visit and the contacts in their cell phones.