There should be a magic orb in your inventory now (miscellaneous section), which you can use to get out of that area.
Make sure you've gotten the level-up jug before leaving, as there is no way to get back after that, short of reloading an earlier save.