An Approximate Riemann Solver for Magnetohydrodynamics