A court in Spain has found former Barcelona and Brazil footballer Dani Alves guilty of raping a woman in a Barcelona nightclub.