US confectioner Hershey Foods has reported a rise in quarterly earnings, boosted by an increase in prices.