U.S. stocks end worst week in a month with sharp losses, as oil weighs