Many single characters in Mandarin Chinese will alter their pronunciation based on the tones of the following, more meaningful characters/words.
For instance, 一 is pronounced yi1 (first tone), but when placed before a fourth tone character, its pronunciation changes to yi2 (second tone). These pronunciation changes help facilitate smooth tonal lines in the production of sentences. (Fun fact, if you ever take a class in harmony/melody and form, you'll start appreciating what "good" vocal lines are vs "bad" ones (in the traditional sense) and it lines up a lot with how tone-changes work in Mandarin).
This is essentially what is happening here, BUT in addition to this, the tone is an indication of the emotional aspect of the character 欸, which is merely a sound indicating some kind of latent emotion. Ei1 to call somebody, Ei2 to ask a question in surprise, Ei3 to indicate some kind of indignation, Ei4 to indicate some kind of affirmation. Essentially, this is the kind of tone that would help emphasize precisely how the speaker is feeling to the listener.