The U.S. stock market records a weekly decline amid sector gains.