Sure. The fiction of the spell is that the magic guides the attack, then the weapon does damage in accordance with physical laws*, much like Guidance, Mage Hand, and the Druid spell for throwing rocks at people.
But the ability talks about attacking with a spell, not hitting with a spell or...