To transfer contacts between two compatible AT&T phones, use AT&T's mobile transfer app. To start the transfer, text TRANSFER to 6565 on your old phone. Your phone then receives a link to the app download, after which you repeat the process on your new phone.
After both phones have the link, connect both to your Wi-Fi network, and select the From This Phone and To This Phone options on the AT&T Mobile Transfer website, and follow the instructions to create QR Codes for both devices. The new phone scans the code on the old one and receives the latter's contacts.