U.S. crude oil inventories rose last week as an increase in imports offset a decline in production, while refineries ran at a lower rate than the week before.