President Vladimir V. Putin vowed to punish those responsible for the assault, one of the deadliest in Russia in decades. U.S. officials have attributed the attack to ISIS-K, a branch of the Islamic State that has been active in Iran and Afghanistan.