Sheriff's deputy pleads guilty, will register as sex offender