Confidence that the debt-ceiling drama could end soon helped lift the S&P 500 and Nasdaq to their highest levels in 9½ months.