Conformal Ward identities for Wilson loops and a test of the duality with gluon amplitudes