After several weeks of steady declines, retail gasoline prices in the United States have turned higher, reflecting a shift in the wholesale market.