At least 34 soldiers were killed in the latest attack by Islamist groups, Niger's military leaders say.