S&P closes at more than two-month high on retail, energy lift