U.S. stocks suffered losses this week with the S&P 500 index ending its streak of four weeks of gains.