Should this have been a goal for Spain?

TSN Video Yesterday

Description

It appeared as if Nico Williams had scored the go-ahead goal for Spain, however the referee deemed there was a foul. Should this goal have counted?

#fifaworldcuponyt