Cowboys' Spencer needs surgery