Using active contours for automated tracking of UV and EUV solar flare ribbons