Droplet phase in a nonlocal isoperimetric problem under confinement