Factories in Spain cut production amid soaring energy prices