Topological magnetoelectric effect in semiconductor nanostructures: Quantum wells, wires, dots, and rings