Sergio Perez took his first GP2 victory with a lights-to-flag performance in Monaco.