Variational characterization for the planar dual Minkowski problem