As pointed out by Austin French's answer, the story writing typically is the responsibility of the Product Owner (PO) in "normal" agile. And in some projects, it's not uncommon for the PO to work with a technical lead to help define the stories so that it is easier for them to be translated into actionable work.
As the question implies, where UX is involved you can't/shouldn't have the PO writing stories that also define UX. If they do, they are essentially defining implementation, which is not the job of the story.
Take for example the example story quoted in another answer...
We need a grid to show Customer Details
The problem with this story is that it's both defining a feature (show customer details) and a UX implementation (a grid).
The story from the PO should be...
We need to show Customer Details
Now it's up to the developers to decide the "how". And the UX designer is the one to decide how the Customer Details should be shown.
That said, you can decide whether you want to treat the UX designer as one of the development team (implementer of stories), or as one of the leads (guider of stories).
UX Designer as Development Team Member
In this approach, the UX designer is one of the developers. Just as a development team might have a database specialist who's taking care of the data portion of stories, the UX designer is taking care of the UX portion of the stories.
UX Designer as Technical Lead
In some agile approaches though, the technical leads will meet with the PO to help define the stories, which then will be passed on to the development team. And with this approach, one might treat the UX designer as one of the leads. The UX designer might have a specific approach to the product in mind that directly influences the stories.
The truth is, whether the PO means to or not they will subconsciously be imagining the UX in their head as they create stories. They will inadvertently influence the UX direction whether they mean to or not. And this is why having them work with a UX designer to help craft the stories can help immensely.
- The PO should not be defining UX (consciously or sub-consciously)
- The UX designer is a "developer" just like a database lead or a software engineer
- UX may actually be a driving force behind design and stories, and as such could/should be part of the story authoring process