Where does user experience begin and end?

Does user experience have a role throughout the entire development lifecycle of a product (in industry), even as far back as determining what stack developers will use? What are the key influences and roles for each part of the project? If it is present in the entire lifecycle, are these done by other people such as business analysts or project managers or do we allow a user experience designer to look after these areas?