Hello Sadia Mehmood
I think they are both the same thing, whereas a minor contribution is fairly through how the application that is in use is being architected by the backend. Now to answer it simple, the UI is what makes the UX, therefore there is no differentiation in between them. Now in real world scenarios, majority of the time, it is the UI and not the functionality that makes an application stand out. To say it in more simple words, an application with a bad functionality but a great UI has more chances of success, than an application with a BAD UI and great functionality. Hope that answers the question.