Probing atom-surface interactions by diffraction of Bose-Einstein condensates