Madrid to appeal against EU ruling on 'illegal aid'