At least 30 people have been injured when a ski lift failed in northern Spain, 17 of them seriously.