Without hearing the melody, Mike's probably got the simplest solution. It's an unusual progression, especially going from the E at the end of the chorus to the D at the beginning of the verse.
And going from IV to I to b7 is also unusual.

If the D at the beginning of the verse sounds like it resolves to the A, it probably is in A all the way through. The E at the end of the chorus would be the V chord.

But another possibility -- which seems most likely to me, not having heard the melody -- is that the song modulates to A in the chorus.

The main reason is because you're mistaken when you say that all of the chords are in both the keys of D and A.

The E major chord is NOT in D. The ii chord in D is Em.
You start the chorus with F#m, which is the iii in the key of D and vi in the key of A. In pop music, using the iii or the vi at the beginnng of the chorus is pretty common. But the IV chord is probably the most common chord to start the chorus on in popular music.

The iii chord is only one note from the I chord, and the vi chord is only one note different from Boththe I AND THE IV.

Two things make me think the chorus modulates to A.
First, the F#m is the vi of A (virtually the same as the IV) and it resolves to A, THEN GOES TO E, NOT Em.
That is a VERY common modulation -- the V of V of the original key. (E is the V of A, which is the V of the original key of D.)

Then the pogression goes back to IV (vi) then to A. At this point it really seems like the key is A.

Lastly, notice that, since a vi chord has two of the three notes in a IV chord, the "two" chord progressions in the chorus are virtually the same if the key is in A.

First progression: F#m(vi, almost IV) A(I) E(V) F#m(vi, almost IV), A (IV)
Second progression: D(IV) A(I) E(V) D(IV) E(V)

Without the melody, I'd say it is in D in the verses and probably stays there until you get to the E major (V of V) in the chorus, where it modulates to A.