US stocks end higher as budget bill spurs optimism