A late attack from Magnus Cort saw the Danish rider edge out Ilan Van Wilder to secure an impressive win on stage 2 of Volta ao Algarve.