Competition of magnetism and superconductivity in underdoped (Ba1- xKx)Fe2As2