Former world No 1 Garbine Muguruza has announced her retirement from professional tennis at the age of 30.