U.S. retail sales increased moderately in April as rising gasoline prices cut into discretionary spending, but consumer spending appeared on track to accelerate after slowing sharply in the first quarter.

The Commerce Department said on Tuesday that retail sales rose 0.3 percent last month after surging 0.8 percent in March. Last month's increase in retail sales was in line with economists' expectations.

Retail sales in April increased 4.7 percent from a year ago.

Excluding automobiles, gasoline, building materials and food services, retail sales rose 0.4 percent last month after increasing 0.5 percent increase in March. These so-called core retail sales correspond most closely with the consumer spending component of gross domestic product.

The U.S. dollar rose to a fresh five-day high against a basket of currencies after the data. Yields on U.S. Treasurys were trading higher and U.S. stocks were trading lower.

Consumer spending braked sharply in the first quarter, growing at its slowest pace in nearly five years, amid delays in processing tax refunds. Economists also say clean-up efforts in the wake of back-to-back hurricanes in late 2017 had pulled forward spending into the fourth quarter.