UI is designing the detailed interface page elements in an order that insures an easy assimilation of information in a visual design that adds enjoyability to the system without distracting its users from the essential tasks to accomplish.
UX is designing the whole system in a way that makes sure it is easy to use and beneficial helping users achieve the tasks they need in a certain environment. It starts with the proper user requirements to setting the right set of features/ functionalities, setting the information architecture, insuring a logical an easy flow between steps, designing the interaction then the UI and finally the user guidance and error messages.
Some even extend it to the whole experience from buying the product to the final after-sale services. As long as a step makes the user satisfied it could be included to maintain the business profitability.