It turns out this way: the UI designer works on the design, and the UX designer decides how to arrange it in the most convenient way for the user. Of course, UX and UI can't exist without each other, and often one specialist combines the functions of a UX and UI designer, but still these concepts are different, and you should definitely not confuse them.