Vladimir Putin has accused Ukraine of committing a "terrorist attack" after an overnight drone attack on a school killed at least six and injured 39.