See as per my knowledge I will say that both differs to each other many respects but yes they are often either miss-considered or one of them is not considered at all (and that is UX testing).
UI testing is more related to GUI testing (Graphical User Interface) i.e. the overall look and feel of the application. It put stress on the appeal of the application like the positioning of the fields, Color of the buttons, tabs. In my opinion this testing is quite important because this is the thing which differentiates between Homemade food and Restaurant food, because there all the dishes are well dressed and served. Also, from user perspective (human perspective) first thing which catches mind attention are the looks of the application and when you get a new release (lets say after 6 months) and you find UI to be updated/changed then definitely it gives a impression that something has changed in the application (especially the end users).
Also, the senior people of the organization (who got a product developed) pay more attention to this UI testing as they need it to be in sync with other products and company Logo and its color etc. I have worked for a client where even 1 pixel of UI distortion was not considered good as they use to pay more (or equal) attention to both UI and functionality. This testing becomes more tedious when you have to test multiple browsers (because sometimes designer have to design browser level CSS).
Now coming to UX i.e. User Experience testing. In our Organization this kind of testing is done by a separate team (known as SAU: Security Accessibility and Usability testing) and very often we include QAs from other projects (we don't include our team QAs for this testing). This testing includes Overall experience of the User with application (User can compare it with other standard applications too, if he/she wants). It includes Accessibility and Usability of the application for different types and different minds of users.
E.g. User here tests that for creating a new record he need to make 5 extra clicks which can be saved, How easy and user friendly is the application is for him/her as a user? So, it can be done manually with Users enriched with such knowledge. That's why I mentioned earlier that we don't include our regular QAs in this testing, because by the time we reach to this stage of testing they already had a mind set that application works in this way, hence they were not able to find UX issues.
UX testing is often neglected or not considered during the delivery of projects for many reasons.