Barcelona beat Real Madrid to sign Andre Gomes