Violent clashes have erupted in Barcelona, with cars set alight and police forced to use pepper spray.