U.S. producer prices rose in July by less than forecasted, reflecting an ongoing moderation in inflationary pressures.