U.S. consumers were more optimistic about the economy in June, according to a report released Tuesday.