A £500m UK government pledge saved Port Talbot’s steelworks from closure, Welsh secretary says.