Quantum state engineering by nondeterministic noiseless linear amplification