Six of the S&P’s 10 sectors advanced in an abbreviated session ahead of the Independence Day holiday as oil prices rallied on revived tensions over the Iranian nuclear program.