I have agreed to do undergraduate research in a lab, but then I found another lab that seems more appealing. What are my obligations?
Unless you have formally signed some sort of agreement to work in the lab of Prof. X, you do not have what amounts to an actual obligation to work in that lab. If you so choose, you could say that you've found a better offer and work in the lab of Prof. Y.

Now, it should be pointed out that even though you've made a commitment to Prof. X's lab, if you choose to honor it (and personally, I would lean toward doing so), it should also be noted that such a promise does not mean you are committed to work in Prof. X's lab exclusively. It is entirely common for undergraduates to bounce around between different positions until they find something they like. Most faculty understand this, and so it shouldn't be a big deal in the long run if you decide to work in Prof. X's lab for six months to a year before trying out Prof. Y's lab.