Reduced switching current density with an off-centered nanocontact in a confined structure