You would equip the sword in one hand and a spell in the other.
So, you can specify which hand does what when equipping things. I think on PC it's right and left mouse button, but it's been a significant minute since I've played on PC. I know that on PlayStation it's right and left bumper (or trigger ... either way), and similar on Xbox. So, you can hit the right bumper to equip a sword in your right (main) hand, and the left bumper to equip a spell in your left (off) hand.
The ONLY reason a sword in your main hand matters is the swing and draw speed. The main hand is faster than the off hand, and spells have a set cast time that isn't affected by the hand it's cast from.