US stocks close week higher