Nuclear spin polarization produced by ion-beam-surface-interaction, its optical detection and use in an atomic quantum-beat experiment