Variational Integration for Ideal Magnetohydrodynamics and Formation of Current Singularities