Phonetic variations driven by prosodic structure and their function in speech production