Gunmen in the Dagestan region of Russia have attacked synagogues, churches and police officers, killing at least 17 people.