A computational simulation of the formation of an ion beam extracted from a magnetically confined ECR plasma is made. The first simulation stage consists of calculating of the electrostatic field produced by an extraction system. The extraction system is composed of three cylindrically hollow symmetrical electrodes and its respective shielding box. For the purpose of calculating the extraction and focalization electrostatic field, a finite-difference algorithm that solves Laplace equation within the ion propagation volume and allows studying the dependency of the electrostatic field on the geometrical configuration of the extraction system is developed. The second stage consists in calculating the electric and magnetic fields due to extracted ions themselves by solving Poisson equation using the fast Fourier transform technique based on a high-order difference approximation with identity expansion scheme. Finally, an algorithm based on Boris integration scheme to calculate ion trajectories with the objective of simulating the movement on an ion beam due to the field generated by electrodes and beam itself is developed. Based upon the results obtained, the search for an optimized ion extraction system from a 14-GHz ECR ion source is begun. Preliminary configurations are obtained and shown.