Ajax were narrowly beaten by Real Madrid, having had a goal controversially disallowed by the video assistant referee.