If you buy from a carrier store they are supposed to transfer them for you, they have machines that make it easy.
Otherwise if your contacts are synced with outlook which I believe they should be automatically on a Windows phone, you can log in with your email account and sync contacts to the new phone.