Barcelona beat Real Madrid 1-0 in the first leg of their Copa del Rey semi-final tie at Santiago Bernabeu on Thursday.