Aberdeen will take a vital away goal into the second leg of their Europa League qualifier after losing 2-1 to Kairat Almaty.