The obstacle problem for a class of hypoelliptic ultraparabolic equations