Quantum effects in collisions of ultracold atoms with walls and nanostructures