Apple said it would pay a one-time tax of $38 billion on its overseas cash holdings and ramp up spending in the U.S., as the world’s most valuable public company seeks to emphasize its contributions to the American economy after years of criticism for outsourcing manufacturing to China.