Here’s a new Mod that’s now available for Moodle 2 and 1.9 which provides an overlaid chat box for logged in users. It works pretty well for 1-to-1 chat for students and teachers (and even admins) and according to the new settings also stores history/logs of all conversations occurring over the platform. The Gmail/Facebook-like chat for Moodle 1.9 is pretty slick (but note that this is still a beta release). I did have some trouble getting it to work/display properly on Chrome and Internet Explorer (but Firefox worked as described).
Check it out at https://github.com/atarplusplus/Moodle_1.9_chat_console